Wednesday, November 22, 2017

Load Excel Name Range Data to SQL Server table, VBA


Sub ShowRecordCount()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .ConnectionString = "Data Source=C:\temp\JW_E&PM_041.xlsx;" & _
"Extended Properties=Excel 12.0;"
    .Open
End With

sSQL = "SELECT * FROM rngloaddata"

Set oRs = New ADODB.Recordset
oRs.Open sSQL, cn, adOpenStatic, adLockBatchOptimistic, adCmdText

Set cn2 = CreateObject("ADODB.Connection")
    With cn2
        .CursorLocation = adUseClient
        .Open "Driver={SQL Server};Server=Server01; Database=budget; UID=DB; PWD=xxxxxx"
        .CommandTimeout = 0
        oRs.MoveFirst
       
   
   
    For i = 0 To Range("rngloaddata").Columns.Count - 1
        strcolnmName = strcolnmName & ", CAST('' AS VARCHAR(255))" & oRs.Fields(i).Name
       
    Next
   
    tablstr = "IF OBJECT_ID('tempdb..##temp1345') IS NOT NULL  drop table ##temp1345     select  " & Right(strcolnmName, Len(strcolnmName) - 1) & " into ##temp1345"
    Debug.Print tablstr
    .Execute tablstr
    Debug.Print tablstr
   
    Do While Not oRs.EOF
    strcolnmValue = ""
            For i = 0 To Range("rngloaddata").Columns.Count - 1
                strcolnmValue = strcolnmValue & ",'" & oRs.Fields(i) & "'"
            Next
       
        .Execute "INSERT INTO ##temp1345 select " & Right(strcolnmValue, Len(strcolnmValue) - 1)
           
            oRs.MoveNext
            Loop
    End With

cn.Close
End Sub

Tuesday, November 21, 2017

Insert Data Using Named range in SQL server table Excel VBA

Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .ConnectionString = "Data Source=C:\temp\JW_E&PM_041.xlsx;" & _
"Extended Properties=Excel 12.0;"
    .Open
End With

sSQL = "SELECT * FROM testrangdata"
'sSQL = "SELECT * FROM [Sheet1$A1:E46]"
Set oRs = New ADODB.Recordset
oRs.Open sSQL, cn, adOpenStatic, adLockBatchOptimistic, adCmdText

Set cn2 = CreateObject("ADODB.Connection")
    With cn2
        .CursorLocation = adUseClient
        .Open "Driver={SQL Server};Server=Server1\SQL1; Database=mydb; UID=bbbbb; PWD=MMMMM"
        .CommandTimeout = 0
        oRs.MoveFirst
        Do While Not oRs.EOF
        Debug.Print oRs.Fields(1)
     
            .Execute "INSERT INTO budget.dbo.delthisTEMP_TABLE ( [BU] ) VALUES ('" & oRs.Fields(1) & "')"
            oRs.MoveNext
            Loop
    End With

cn.Close

XLSX excel vba connectionstring

Sub test()

Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:\temp\JW_E&PM_04.xlsx;" & _
"Extended Properties=Excel 8.0;"
.Open
End With
End Sub


Sub ShowRecordCount()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .ConnectionString = "Data Source=C:\temp\JW_E&PM_04.xlsx;" & _
"Extended Properties=Excel 12.0;"
    .Open
End With

sSQL = "SELECT * FROM [sheet1$]"
Set oRs = New ADODB.Recordset
oRs.Open sSQL, cn, adOpenStatic, _
               adLockBatchOptimistic, adCmdText
MsgBox oRs.RecordCount
cn.Close
End Sub


read named range in VBA


Sub ShowRecordCount()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .ConnectionString = "Data Source=C:\temp\JW_E&PM_04.xlsx;" & _
"Extended Properties=Excel 12.0;"
    .Open
End With

sSQL = "SELECT * FROM testrange"
'sSQL = "SELECT * FROM [Sheet1$A1:E46]"
Set oRs = New ADODB.Recordset
oRs.Open sSQL, cn, adOpenStatic, _
               adLockBatchOptimistic, adCmdText
MsgBox oRs.RecordCount
cn.Close
End Sub

Thursday, November 2, 2017

Convert Amount into currency with $ sign and commas using jquery/javascript

currentamount.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")

Wednesday, October 25, 2017

JD Edwards - Pass Value to UBE/Application in URL

Topic related to this:-
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=371210426635792&id=748331.1&_afrWindowMode=0&_adf.ctrl-state=ydq9vvmc_4




How to create and get access of JD Edwards application
http://oooooo.sssssss.com/jde/E1Menu.maf?OID=P0011_W0011A&User=rajeev&Password=xxxxxx&Environment=p&FormDSTmpl=|2|&FormDSData=|99999|&selectJPD910=*ALL

http://oracle.SSSSSSSS.com/jde/E1Menu.maf?OID=P0011_W0011_ZJDE0001A&FormDSTmpl=|1|&FormDSData=|G|




Sunday, October 22, 2017

Create Excel Office addin using C# – Part 1 (Ribbon Designer)



https://sandeepfabiani.wordpress.com/2013/08/24/create-excel-office-addin-using-csharp-ribbon-designer/

Saturday, October 14, 2017

Inventory Stock Report - JD Edwards UBE









Listing of ER for Report: Report : Expected Sales/GP by  Branch Plant * Item (R55COST02A)

***********************************************************************
     GLOBALS: Variables (Global)
***********************************************************************
     rpt_LedgType_LEDG21
     rpt_MCU_NO_Space
     rpt_MCU_AN8
     rpt_SalesReportingCode1
     rpt_SalesReportingCode2
     rpt_SalesReportingCode3
     rpt_SalesReportingCode4
     rpt_AlternateAddressKey_ALKY
     rpt_ForOwner_AN8
     rpt_NameGiven_GNNM
     rpt_NameSurname_SRNM
     rpt_HubMgr_CMC1
     rpt_ForHub_AN8

=======================================================================
     SECTION: Page Header [PAGE HEADER] (S3)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 RV VersionName = SL VersionName

=======================================================================
     SECTION: OnHand qty  by item/BP/SRP1/Company [GROUP SECTION] (S4)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Set Selection Append Flag(<Yes>)
0002 Set User Selection(BC Cost Method (F4105)(LEDG), <Equal To>, "02", <And>)
0003 Set User Selection(BC Quantity on Hand - Primary units (F41021)(PQOH), <Not Equal To>, <Zero>, <And>)
0004 Set User Selection(BC Quantity on Hand - Primary units (F41021)(PQOH), <Not Equal To>, "0", <And>)
0005 Set User Selection(BC Quantity on Hand - Primary units (F41021)(PQOH), <Not Equal To>, <Blank>, <None>)

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0004 RV Extended Cost02 = [BC Quantity on Hand - Primary units (F41021)(PQOH)]*[BC Amount - Unit Cost (F4105)(UNCS)]
0005 RV CompanyFooter = BC Company (F0006)(CO)
0006 RV BusinessUnitFooter = BC Business Unit (F41021)(MCU)
0007 RV DescriptionCompressedBUFooter = BC Description - Compressed (F0006)(DC)
0008 RV Description_ITEM = substr([BC Description (F4101)(DSC1)],0,30)
0009 RV Location_ITEM = substr([BC Location (F41021)(LOCN)],0,20)
0010 VA rpt_LedgType_LEDG21 = "21"
0011 RV Unit Cost21 = 0.00
0012 F4105.Fetch Single
0013 RV Extended Cost21 = [BC Quantity on Hand - Primary units (F41021)(PQOH)]*[RV Unit Cost21]
0014 If RV Extended Cost21 is greater than <Zero> Or RV Extended Cost21 is greater than <Blank>
0015    RV GrossProfit = (([RV Extended Cost21]-[RV Extended Cost02])/[RV Extended Cost21])*100
0016 Else
0017    RV GrossProfit = 0.00
0018 End If
0020 ! Get UDC Description (Obsolete)
0021 ! Get UDC Description (Obsolete)
0022 ! Get UDC Description (Obsolete)
0023 ! Get UDC Description (Obsolete)
0025 RV SRP1 = BC Sales Catalog Section (F4101)(SRP1)
0026 RV SRP2 = BC Sub Section (F4101)(SRP2)
0027 RV SRP3 = BC Sales Category Code 3 (F4101)(SRP3)
0028 RV SRP4 = BC Sales Category Code 4 (F4101)(SRP4)
0029 RV SRP5 = BC Sales Category Code 5 (F4101)(SRP5)
0031 VA rpt_AlternateAddressKey_ALKY = rtrim(ltrim([BC Business Unit (F41021)(MCU)],' '),' ')
0034 VA rpt_NameGiven_GNNM = ""
0035 VA rpt_NameSurname_SRNM = ""
0036 VA rpt_ForHub_AN8 = ""
0037 VA rpt_HubMgr_CMC1 = ""
0038 F0101.Fetch Single
0040 F41001.Fetch Single
0041 F0111.Fetch Single
0043 RV Ownername = concat(concat(rtrim([VA rpt_NameGiven_GNNM],' '),"  "),[VA rpt_NameSurname_SRNM])
0044 VA rpt_NameGiven_GNNM = ""
0045 VA rpt_NameSurname_SRNM = ""
0047 F0101.Fetch Single
0049 F550354.Fetch Single
0050 F0111.Fetch Single
0051 RV HubMgrName = concat(concat(rtrim([VA rpt_NameGiven_GNNM],' '),"  "),[VA rpt_NameSurname_SRNM])

=======================================================================
     SECTION: On Business Unit [GROUP SECTION] (S5)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0002 VA rpt_MCU_NO_Space = ltrim([PC Business Unit (F0006)(MCU)],' ')
0003 F0101.Fetch Single
0004 F0111.Fetch Single
0005 RV FirstName = rtrim([RV FirstName],'  ')
0006 RV FirstName = concat(concat([RV FirstName],"  "),[RV LastName])
0008 If RV Total of Extended Cost21_OnBu is greater than <Zero> Or RV Total of Extended Cost21_OnBu is greater than <Blank>
0009    RV GrossProfit_OnBU = (([RV Total of Extended Cost21_OnBu]-[RV Total of Extended Cost02_OnBU])/[RV Total of Extended Cost21_OnBu])*100
0010 Else
0011    RV GrossProfit_OnBU = 0.00
0012 End If

=======================================================================
     SECTION: On Company [GROUP SECTION] (S8)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 If RV Total of Extended Cost21_OnComp is greater than <Zero> Or RV Total of Extended Cost21_OnComp is greater than <Blank>
0002    RV GrossProfit_OnComp = (([RV Total of Extended Cost21_OnComp]-[RV Total of Extended Cost02_OnComp])/[RV Total of Extended Cost21_OnComp])*100
0003 Else
0004    RV GrossProfit_OnComp = 0.00
0005 End If

Saturday October 14, 2017  11:22


Sunday, October 8, 2017

Convert Row Into Column Dynamic completely PIVOT SQL Server

Need to create 12 month rolling report , user will enter year and Month , need to show report Month (YYYY-MM) on Top from F0911 , which is a detail table in JD Edwards , Amount is in row.
also Year and Month is in Row.


alter proc SP_ActualByAdminRollingAmt
--declare
@frmPN varchar(7) ='2017-08'

as



declare @frmdate datetime =@frmPN+'-01'
declare @TOdate datetime =DATEADD(M,-12, @frmPN+'-01')



--drop table #temp11
--drop table #temp12
--drop table #temp13



select
glaid,
glmcu,
glObj ,glsub,
glsblt,GLSBL,
glan8 ,
glfy,
glpn,
glaa
into #temp11
from mfdb.proddta.f0911 with(nolock)
where glfy in(17,16) and gllt='AA'  and left(globj,2) in('60','61')
 and gldgj>=[dbo].[JDT_GTJ](@TOdate) and gldgj<=[dbo].[JDT_GTJ](@frmdate)
--JDT_GTJ - function to convert calendar date to Julian date
and glco=1 and glaa<>0

--print [dbo].[JDT_GTJ](@frmdate)
--print [dbo].[JDT_GTJ](@TOdate)


select
glmcu,
mcdl01,
glObj Obj,
GmDL01 Obj_Desc,
ltrim(glsblt+ltrim(GLSBL)) Subledger,
DRDL01 Subledger_Desc,
glan8 VendorNo,
abalph VendorName,
glfy,
glpn,
sum(glaa)/100 glaa,
 case when glfy=17 then '2017-' + right('0'+cast(glpn as varchar(2)),2) else '2016-' + right('0'+cast(glpn as varchar(2)),2)  end  Period  into #temp12
 from  #temp11
left outer join proddta.f0101 on aban8=glan8
left outer join proddta.f0901 on gmaid=glaid
left outer join proddta.f0006 on mcmcu=glmcu
LEFT OUTER JOIN PRODCTL.F0005 ON DRSY='55' AND DRRT='SL'  AND LTRIM(DRKY)=LTRIM(GLSBL)
where left(glObj,2) in('60','61')
group by glObj,GmDL01,glsblt+ltrim(GLSBL) ,DRDL01,glan8,abalph,glfy,
glpn,glmcu,mcdl01



----main logic PIVOT

select distinct Period into #temp13 from  #temp12
DECLARE @cols AS NVARCHAR(MAX);

-- need to do following as amount filed which are in Row---

--set @cols='[2016-08],[2016-09],[2016-10],[2016-11],[2016-12], [2017-01],[2017-02],[2017-03],-----[2017-04],[2017-05],[2017-06],[2017-07],[2017-08],[2017-09],[2017-10],[2017-11],[2017-12]'



select @cols = STUFF((SELECT distinct ',' +
                        QUOTENAME(Period)
                      FROM #temp13
                      FOR XML PATH(''), TYPE
                     ).value('.', 'NVARCHAR(MAX)')
                        , 1, 1, '');


DECLARE @query AS NVARCHAR(MAX);
set @query=
'SELECT * FROM(SELECT ltrim(glmcu) BU,mcdl01 BU_Desc,Obj, Obj_Desc, Subledger, Subledger_Desc, VendorNo, VendorName ,glaa,[Period]
  FROM #temp12 )t PIVOT (SUM([glaa])
  FOR [Period] IN ( ' + @cols + ' )' +
' ) AS pvt
order by 1,3,5'
execute(@query);
 



Friday, September 29, 2017

Getting Error in JDE Developer tool - Form Interconnect

  During development when I am joining two screen getting this error in JDE Development environment, not able to proceed further in development. 
How to Fix:
In order to fix this error, We can try to deploying full package at FAT machine.  


 







--
Rajeev Kumar
949-378-6094

Wednesday, September 20, 2017

Currency Validation textbox asp.net

<asp:RegularExpressionValidator ID="rvcheckno" runat="server"
                                                ErrorMessage="Amount receive numbers only!" ControlToValidate="tbamount"
                                                InitialValue="0" ValidationGroup="number">
                                                </asp:RegularExpressionValidator>

Send Email using SmtpClient C# ASP.Net

string MessageBody;

        MailAddress mfrom = new MailAddress("ControlsTeam@xxxxxxxx.com");
        MailAddress mTo = new MailAddress(getemail);
        //MailAddress mcc = new MailAddress(getemail);
        string EmailSubject = "This Control ID:" + ctrlID + "has been Update";
        MailMessage message = new MailMessage();
        message.From = mfrom;
        message.To.Add(mTo);
        //message.CC.Add(mcc);
        if (string.Equals(mfrom.ToString().ToUpper().ToString(), mTo.ToString().ToUpper().ToString()))
        {
            MessageBody = "This control ID" + ctrlID + "has been changed";
            EmailSubject = TextBox1.Text + "Test Email";
        }
        message.Subject = EmailSubject;
        message.Body = "This is the test Email for Control Update"; ;
        message.IsBodyHtml = true;


        SmtpClient client = new SmtpClient("xxxxx.xxxx.xxxx", 25);//server name
        // Credentials are necessary if the server requires the client
        // to authenticate before it will send e-mail on the client's behalf.
        client.UseDefaultCredentials = true;
        message.IsBodyHtml = true;

        client.Send(message);

Monday, September 4, 2017

JD Edwards UBE - Create Flat/CSV file

1. Create a Processing Option and define output file.
Initialize section open your file and write headers of the columns
Do section put your all the logic and write line in text file.


End Section - close you file---Done
Open File Code
Write a line
Close



Listing of ER for Report: Report : Sam's Dot Com 846 (R5541004A)

***********************************************************************
     GLOBALS: Variables (Global)
***********************************************************************
     rpt_IdentifierShortItem_ITM
     rpt_QtyOnHandPrimaryUn_PQOH
     rpt_ErrorCode_ERRC
     rpt_GenericLong_GENLNG
     rpt_VariableLengthField1_VAR1
     rpt_SearchString_SerchString

=======================================================================
     SECTION: Item Cross Reference [GROUP SECTION] (S1)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 //
0002 VA rpt_SearchString_SerchString = concat(concat(rtrim([PO szDPSINBOUNDFORECAST],' '),rtrim([PO szAddressLine1_HiringLocation],' ')),[PO szAlphaSpecData08])
0003 Open Flat File
        "1" -> BF cSuppressErrorMessage
        VA rpt_ErrorCode_ERRC <- BF cErrorCode
        VA rpt_GenericLong_GENLNG <- BF idFilePtr
        VA rpt_SearchString_SerchString -> BF szFilePath
0004 //
0005 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Vendor Number")
0006 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0007 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Supplier")
0008 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0009 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Country")
0010 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0011 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Sams Club Item Number")
0012 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0013 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"UPC")
0014 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0015 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Vendor Item Number")
0016 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0017 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Description")
0018 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0019 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"QTY")
0020 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0021 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"UOM")
0022 // Write Header
0023 Write One Line To Flat File
        "1" -> BF cSuppressErrorMessage
        VA rpt_ErrorCode_ERRC <- BF cErrorCode
        VA rpt_GenericLong_GENLNG -> BF idFilePtr
        VA rpt_VariableLengthField1_VAR1 -> BF szRecord

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 //
0002 Suppress Section Write
0003 //
0004 //
0005 VA rpt_IdentifierShortItem_ITM = BC Item Number - Short (F4104)(ITM)
0006 RV Country = "US"
0007 RV UM = "EA"
0008 RV Qty_PQOH = ""
0009 F0101.Fetch Single
        BC Address Number (F4104)(AN8) =  TK Address Number
        RV Alph_Vendor <- TK Name - Alpha
0010 Do Custom Section(RS Item Availability Browse)
0011 RV Qty_PQOH = VA rpt_QtyOnHandPrimaryUn_PQOH
0012 //
0013 VA rpt_VariableLengthField1_VAR1 = ""
0014 //
0015 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[BC Address Number (F4104)(AN8)])
0016 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0017 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV Alph_Vendor])
0018 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0019 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV Country])
0020 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0021 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[BC Item Number - Customer/Supplier (F4104)(CITM)])
0022 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0023 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[BC Description - Line 2 (F4104)(DSC2)])
0024 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0025 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[BC 2nd Item Number (F4104)(LITM)])
0026 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0027 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[BC Description (F4104)(DSC1)])
0028 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0029 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV Qty_PQOH])
0030 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0031 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV UM])
0032 //
0033 //
0034 Write One Line To Flat File
        <Zero> -> BF cSuppressErrorMessage
        VA rpt_ErrorCode_ERRC <- BF cErrorCode
        VA rpt_GenericLong_GENLNG -> BF idFilePtr
        VA rpt_VariableLengthField1_VAR1 -> BF szRecord

-----------------------------------------------------------------------
     EVENT:  End Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 //
0002 Close Flat File
        <Blank> -> BF cSuppressErrorMessage
        VA rpt_ErrorCode_ERRC <- BF cErrorCode
        VA rpt_GenericLong_GENLNG -> BF idFilePtr

=======================================================================
     SECTION: Page Header [PAGE HEADER] (S2)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Suppress Section Write

=======================================================================
     SECTION: Item Availability Browse [GROUP SECTION] (S3)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Set Selection Append Flag(<Yes>)
0002 Set User Selection(BC Item Number - Short (F41021)(ITM), <Equal To>, VA rpt_IdentifierShortItem_ITM, <And>)
0003 ! Set User Selection(BC Business Unit (F41021)(MCU), <Equal To>, "  MIDWEST-SC", <None>)
0004 Set User Selection(BC Business Unit (F41021)(MCU), <Equal To>, "DALLAS-CERTS", <None>)

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 VA rpt_QtyOnHandPrimaryUn_PQOH = [VA rpt_QtyOnHandPrimaryUn_PQOH]+[BC Quantity on Hand - Primary units (F41021)(PQOH)]

Monday September 04, 2017  17:42




Tuesday, August 29, 2017

http://techbrij.com/show-modal-popup-edit-aspdotnet-gridview

Show ModalPopUp to Edit Asp.net



Wednesday, August 23, 2017

remove leading zeros SQL Server

 PATINDEX('%[^0]%', glcknu+'.'), LEN(glcknu)) = '' THEN '0' ELSE SUBSTRING(glcknu, PATINDEX('%[^0]%', glcknu+'.'), LEN(glcknu)) END 

Thursday, August 10, 2017

JD Edwards Report Output in any Folder UBE

Listing of ER for Report: Report : Sales Orders For SSSSSSSS(R554268J)

***********************************************************************
     GLOBALS: Variables (Global)
***********************************************************************
     rpt_DocumentOrderInvoiceE
     rpt_OrderType
     rpt_ABShipTo_Owner
     rpt_NameGiven
     rpt_NameSurname
     rpt_LineNumber
     rpt_PhoneNumberType
     rpt_PhoneAreaCode1
     rpt_PhoneNumber
     rpt_SequenceNumber70
     rpt_Count
     rpt_Count1
     rpt_CompanyKeyOrderNo
     rpt_StatusCodeNext
     rpt_LineType
     rpt_StatusCodeLast
     rpt_CompanyKeyOrderNo_Header
     rpt_LineNumberHeader
     rpt_UnitOfMeasure_1
     rpt_UnitOfMeasure_2
     rpt_RelatedUnitOfMeasure_1
     rpt_RelatedUnitOfMeasure_2
     rpt_ConversionFactor_1
     rpt_ConversionFactor_2
     rpt_DateBeginningEffective
     rpt_ReportCodeAddBook009
     rpt_ReportCodeAddBook008
     rpt_GroupUnitOfMeasure
     rpt_LineNumberDetail
     rpt_GroupUnitOfMeasureH1
     rpt_GroupUnitOfMeasureH2
     rpt_GroupUnitOfMeasureH3
     rpt_DateForDataExtr
     rpt_CountWOConf
     rpt_CallDetailWO_CF
     rpt_GT_DateForConf
     rpt_DateRequested_detail
     rpt_Qty_ship_C1
     rpt_Qty_ship_C2
     rpt_Qty_ship_C3
     rpt_ShippingConditionsCode_1
     rpt_AC03_YN
     rpt_AC07YN
     rpt_TimeLastUpdated
     rpt_CountLineNumber
     rpt_CountLineNumberTot
     rpt_QuantityTimeSeries01
     rpt_QuantityTimeSeries02
     rpt_QuantityTimeSeries03
     rpt_GenericLong_GENLNG
     rpt_ErrorCode_ERRC
     rpt_VariableLengthField1_VAR1
     rpt_CountTeamId_CTAN
     rpt_WriteHeaderYesOrNoEntry_YN
     rpt_FileName_AA114
     rpt_FileDate_AA15

=======================================================================
     SECTION: F4201 + F0101 + F0116 on  SHAN [GROUP SECTION] (S1)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 VA rpt_CountLineNumber = 0
0002 VA rpt_VariableLengthField1_VAR1 = ""
0003 VA rpt_DateForDataExtr = add_days(date_today(),1)
0004 Set Selection Append Flag()
0005 Set User Selection(BC Date - Requested (F4201)(DRQJ), , VA rpt_DateForDataExtr, )

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0002 Hide Section
0004 VA rpt_Count = 0
0005 VA rpt_CountLineNumber = 1
0006 VA rpt_WriteHeaderYesOrNoEntry_YN = "Y"
0007 ! RV From_MCU = "."
0008 RV SHC5 = "."
0009 VA rpt_VariableLengthField1_VAR1 = ""
0011 VA rpt_CountWOConf = 0
0012 VA rpt_CallDetailWO_CF = ""
0014 ! Write One Line To Flat File
0015 VA rpt_DocumentOrderInvoiceE = 0
0016 VA rpt_OrderType = ""
0017 VA rpt_StatusCodeLast = ""
0018 VA rpt_StatusCodeNext = ""
0019 VA rpt_StatusCodeNext = ""
0020 VA rpt_DateRequested_detail = ""
0021 ! VA rpt_Count = 0
0022 VA rpt_ReportCodeAddBook009 = ""
0023 VA rpt_ReportCodeAddBook008 = ""
0024 RV From_MCU = BC Business Unit (F4201)(MCU)
0026 F4211.Fetch Single
0027 While SV File_IO_Status is equal to CO SUCCESS
0028    If VA rpt_LineType is equal to "S" And VA rpt_StatusCodeNext is equal to "540" And VA rpt_StatusCodeLast is not equal to "980"
0029       F5542324.Fetch Single
0030       If SV File_IO_Status is equal to CO SUCCESS
0031       Else
0032          VA rpt_Count = 1+[VA rpt_Count]
0033          VA rpt_CountWOConf = VA rpt_Count
0035          VA rpt_DocumentOrderInvoiceE = BC Document (Order No, Invoice, etc.) (F4201)(DOCO)
0036          VA rpt_OrderType = BC Order Type (F4201)(DCTO)
0037          VA rpt_CompanyKeyOrderNo = BC Document Company (Original Order) (F4201)(OKCO)
0039       End If
0040    Else
0041    End If
0042    F4211.Fetch Next
0043 End While
0046 ! RV DRQJ_Detail = VA rpt_DateRequested_detail
0047 RV DRQJ_Detail = BC Date - Requested (F4201)(DRQJ)
0050 VA rpt_GroupUnitOfMeasureH1 = ""
0051 VA rpt_GroupUnitOfMeasureH2 = ""
0052 VA rpt_GroupUnitOfMeasureH3 = ""
0053 VA rpt_QuantityTimeSeries03 = 0
0054 VA rpt_QuantityTimeSeries02 = 0
0055 VA rpt_QuantityTimeSeries01 = 0
0056 F5541261.Fetch Single
0057 If SV File_IO_Status is equal to CO SUCCESS
0059    If VA rpt_QuantityTimeSeries01 is equal to And VA rpt_QuantityTimeSeries02 is equal to And VA rpt_QuantityTimeSeries03 is equal to
0060       VA rpt_Count = 0
0061    Else
0062    End If
0063 Else
0065    If VA rpt_CountWOConf is not equal to
0066       VA rpt_CallDetailWO_CF = "99999"
0067    Else
0068    End If
0070    VA rpt_Count = 0
0071 End If
0076 F554247T.Fetch Single
0077 If SV File_IO_Status is equal to CO SUCCESS
0078 Else
0079    VA rpt_Count = 0
0080 End If
0084 RV OrderStatus = "N"
0088 F5542324.Fetch Single
0089 If SV File_IO_Status is equal to CO SUCCESS
0090    VA rpt_Count = 0
0091    VA rpt_WriteHeaderYesOrNoEntry_YN = "N"
0092    Suppress Section Write
0093 Else
0094 !    RV OrderStatus = "N"
0095 End If
0104 If VA rpt_Count is not equal to
0106    F41001.Fetch Single
0109    VA rpt_LineNumber = 0
0110    F0111.Fetch Single
0111    RV ShipOwnerName = concat(concat(rtrim([VA rpt_NameGiven],' ')," "),ltrim([VA rpt_NameSurname],' '))
0115    VA rpt_PhoneAreaCode1 = " "
0116    VA rpt_PhoneNumber = " "
0117    VA rpt_SequenceNumber70 = 1
0118    VA rpt_LineNumber = 0
0119    RV PhoneNo = " "
0120    F0115.Fetch Single
0121    If VA rpt_PhoneAreaCode1 is equal to
0122       RV PhoneNo = [VA rpt_PhoneNumber]
0123    Else
0124       RV PhoneNo = concat(concat(rtrim([VA rpt_PhoneAreaCode1],' '),"-"),ltrim([VA rpt_PhoneNumber],' '))
0125    End If
0129 !    RV PhoneNo = ltrim([VA rpt_PhoneNumber],' ')
0130    VA rpt_DocumentOrderInvoiceE = BC Document (Order No, Invoice, etc.) (F4201)(DOCO)
0131    VA rpt_OrderType = BC Order Type (F4201)(DCTO)
0132    VA rpt_CompanyKeyOrderNo = BC Document Company (Original Order) (F4201)(OKCO)
0133    RV OrderDate_1 = concat(concat(concat(concat(lpad(date_month([BC Date - Order/Transaction (F4201)(TRDJ)]),'0',2),"/"),lpad(date_day([BC Date - Order/Transaction (F4201)(TRDJ)]),'0',2)),"/"),date_year([BC Date - Order/Transaction (F4201)(TRDJ)]))
0134    RV DateRequested = concat(concat(concat(concat(lpad(date_month([BC Date - Requested (F4201)(DRQJ)]),'0',2),"/"),lpad(date_day([BC Date - Requested (F4201)(DRQJ)]),'0',2)),"/"),date_year([BC Date - Requested (F4201)(DRQJ)]))
0135    RV SHC5_MCU = [BC Business Unit (F4201)(MCU)]
0136    Add a Carrige Return to String
0140    VA rpt_CountLineNumberTot = [VA rpt_CountLineNumberTot]+[VA rpt_CountLineNumber]
0141 Else
0142    VA rpt_WriteHeaderYesOrNoEntry_YN = "N"
0143    Suppress Section Write
0145 !    VA rpt_DocumentOrderInvoiceE = 0
0146 !    VA rpt_OrderType = ""
0147 !    VA rpt_StatusCodeLast = ""
0148 !    VA rpt_StatusCodeNext = ""
0149 !    VA rpt_StatusCodeNext = ""
0150 !    VA rpt_Count = 0
0152 End If
0155 F4006.Fetch Single
0156 If SV File_IO_Status is equal to CO SUCCESS
0157    F4006.Fetch Single
0158 Else
0159 End If
0164 RV SHC7_AN8 = [BC Address Number (F4201)(AN8)]
0165 F0101.Fetch Single
0166 F0116.Fetch Single
0169 ! If BC Address Number (F4201)(AN8) is equal to "296091,356091"
0170    F550145.Fetch Single
0171    If SV File_IO_Status is equal to CO SUCCESS
0172       F550145.Fetch Single
0173    Else
0174 !    Else
0175       F03012.Fetch Single
0176       Get UDC Description (Obsolete)
0177       Get UDC Description (Obsolete)
0178    End If
0179 ! End If
0181 RV SHAN_WH_Pro = "1"
0182 RV SHAN_Pallet = "1"
0184 ! Add a Carrige Return to String
0187 RV CarrierNo = BC Carrier Number (F4201)(CARS)
0188 F0101.Fetch Single
0191 RV PONO1 = BC Reference (F4201)(VR01)
0195 ! VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0196 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"H,xxxxxx,")
0198 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Document (Order No, Invoice, etc.) (F4201)(DOCO)],' '),' '),","))
0200 If RV PONO is not equal to
0201    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV PONO],' '),' '),","))
0202 Else
0203    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0204 End If
0206 If RV OrderStatus is not equal to
0207    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV OrderStatus],' '),' '),","))
0208 Else
0209    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0210 End If
0212 If RV OrderDate_1 is not equal to
0213    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV OrderDate_1],' '),' '),","))
0214 Else
0215    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0216 End If
0219 If RV PO_Date is not equal to
0220    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV PO_Date],' '),' '),","))
0221 Else
0222    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0223 End If
0226 If RV DRQJ_Detail is not equal to
0227    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV DRQJ_Detail],' '),' '),","))
0228 Else
0229    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0230 End If
0232 If BC Name - Alpha (F0101)(ALPH) is not equal to
0233    Replace Character in String
0234    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Name - Alpha (F0101)(ALPH)],' '),' '),","))
0235 Else
0236    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0237 End If
0239 If BC Address Number - Ship To (F4201)(SHAN) is not equal to
0240    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Address Number - Ship To (F4201)(SHAN)],' '),' '),","))
0241 Else
0242    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0243 End If
0246 If BC Address Line 1 (F0116)(ADD1) is not equal to
0247    Replace Character in String
0248    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Address Line 1 (F0116)(ADD1)],' '),' '),","))
0249 Else
0250    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0251 End If
0254 If BC Address Line 2 (F0116)(ADD2) is not equal to
0255    Replace Character in String
0256    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Address Line 2 (F0116)(ADD2)],' '),' '),","))
0257 Else
0258    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0259 End If
0261 If BC City (F0116)(CTY1) is not equal to
0262    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC City (F0116)(CTY1)],' '),' '),","))
0263 Else
0264    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0265 End If
0268 If BC State (F0116)(ADDS) is not equal to
0269    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC State (F0116)(ADDS)],' '),' '),","))
0270 Else
0271    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0272 End If
0275 If BC Postal Code (F0116)(ADDZ) is not equal to
0276    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Postal Code (F0116)(ADDZ)],' '),' '),","))
0277 Else
0278    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0279 End If
0282 If BC Country (F0116)(CTR) is not equal to
0283    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Country (F0116)(CTR)],' '),' '),","))
0284 Else
0285    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0286 End If
0288 ! If RV Shipto_MCU is not equal to
0289 !    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Shipto_MCU],' '),' '),","))
0290 ! Else
0291 !    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0292 ! End If
0295 If RV Shipto_MCU is not equal to
0296    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Shipto_MCU],' '),' '),","))
0297 Else
0298    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0299 End If
0303 If RV From_MCU is not equal to
0304    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV From_MCU],' '),' '),","))
0305 Else
0306    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0307 End If
0310 If RV ShipOwnerName is not equal to
0311    Replace Character in String
0312    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ShipOwnerName],' '),' '),","))
0313 Else
0314    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0315 End If
0317 If RV PhoneNo is not equal to
0318    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV PhoneNo],' '),' '),","))
0319 Else
0320    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0321 End If
0324 If RV SHAN_AC03 is not equal to
0325    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC03],' '),' '),","))
0326 Else
0327    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0328 End If
0331 If RV SHAN_AC04 is not equal to
0332    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC04],' '),' '),","))
0333 Else
0334    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0335 End If
0338 If RV SHAN_AC05 is not equal to
0339    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC05],' '),' '),","))
0340 Else
0341    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0342 End If
0345 If RV SHAN_AC06 is not equal to
0346    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC06],' '),' '),","))
0347 Else
0348    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0349 End If
0352 If RV SHAN_AC07 is not equal to
0353    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC07],' '),' '),","))
0354 Else
0355    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0356 End If
0359 If RV SHAN_AC08 is not equal to
0360    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC08],' '),' '),","))
0361 Else
0362    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0363 End If
0365 If RV SHAN_AC09 is not equal to
0366    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_AC09],' '),' '),","))
0367 Else
0368    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0369 End If
0371 If RV SHAN_DEL1 is not equal to
0372    Replace Character in String
0373    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_DEL1],' '),' '),","))
0374 Else
0375    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0376 End If
0379 If RV SHAN_DEL2 is not equal to
0380    Replace Character in String
0381    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHAN_DEL2],' '),' '),","))
0382 Else
0383    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0384 End If
0386 If RV SHC7_AN8 is not equal to
0387    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHC7_AN8],' '),' '),","))
0388 Else
0389    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0390 End If
0393 If RV AN8_CompanyName is not equal to
0394    Replace Character in String
0395    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_CompanyName],' '),' '),","))
0396 !    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(concat("''",concat([RV AN8_CompanyName],"'' ")),' '),' '),","))
0397 Else
0398    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0399 End If
0402 If RV AN8_Add1 is not equal to
0403    Replace Character in String
0404    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_Add1],' '),' '),","))
0405 Else
0406    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0407 End If
0410 If RV AN8_Add2 is not equal to
0411    Replace Character in String
0412    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_Add2],' '),' '),","))
0413 Else
0414    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0415 End If
0418 If RV AN8_City is not equal to
0419    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_City],' '),' '),","))
0420 Else
0421    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0422 End If
0425 If RV AN8_State is not equal to
0426    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_State],' '),' '),","))
0427 Else
0428    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0429 End If
0432 If RV AN8_Zip is not equal to
0433    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_Zip],' '),' '),","))
0434 Else
0435    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0436 End If
0439 If RV AN8_Country is not equal to
0440    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV AN8_Country],' '),' '),","))
0441 Else
0442    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0443 End If
0446 If RV CarrierNo is not equal to
0447    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV CarrierNo],' '),' '),","))
0448 Else
0449    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0450 End If
0453 If RV AN8_Add1 is not equal to
0454    Replace Character in String
0455    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Carr_ALPH],' '),' '),","))
0456 Else
0457    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0458 End If
0462 If RV SHC3 is not equal to
0463    Replace Character in String
0464    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHC3],' '),' '),","))
0465 Else
0466    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0467 End If
0470 If RV SHC4 is not equal to
0471    Replace Character in String
0472    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHC4],' '),' '),","))
0473 Else
0474    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0475 End If
0477 If RV CompName_01A is not equal to
0478    Replace Character in String
0479    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV CompName_01A],' '),' '),","))
0480 Else
0481    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0482 End If
0485 If RV Add1_01A is not equal to
0486    Replace Character in String
0487    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Add1_01A],' '),' '),","))
0488 Else
0489    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0490 End If
0493 If RV Add2_01A is not equal to
0494    Replace Character in String
0495    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Add2_01A],' '),' '),","))
0496 Else
0497    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0498 End If
0500 If RV City_01A is not equal to
0501    Replace Character in String
0502    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV City_01A],' '),' '),","))
0503 Else
0504    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0505 End If
0507 If RV State_01A is not equal to
0508 !    Replace Character in String
0509    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV State_01A],' '),' '),","))
0510 Else
0511    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0512 End If
0514 If RV Zip_01A is not equal to
0515    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Zip_01A],' '),' '),","))
0516 Else
0517    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0518 End If
0520 If RV CompName_01A is not equal to
0521    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Counrty_01A],' '),' '),","))
0522 Else
0523    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0524 End If
0527 If RV SHC5 is not equal to
0528    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SHC5],' '),' '),","))
0529 Else
0530    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0531 End If
0547 If VA rpt_WriteHeaderYesOrNoEntry_YN is equal to "Y"
0548    Write One Line To Flat File
0549 Else
0550 End If

-----------------------------------------------------------------------
     EVENT:  End Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 ! Close Flat File

-----------------------------------------------------------------------
     EVENT:  Init Break Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 ! If VA rpt_Count is not equal to
0002 !    Do Custom Section(RS Union F4211 & F42119 -All Fields)
0003 ! Else
0004 ! End If

-----------------------------------------------------------------------
     EVENT:  End Break Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0004 F03012.Fetch Single
0005 ! VA rpt_CallDetailWO_CF = "99999"
0006 If VA rpt_CallDetailWO_CF is equal to "99999"
0007    If BC Order Type (F4201)(DCTO) is equal to "S6,SW"
0008       F5542528.Insert
0009    End If
0010    Do Custom Section(RS Union F4211 & F42119 -All Fields)
0011 Else
0012    If VA rpt_Count is not equal to
0013       If BC Order Type (F4201)(DCTO) is equal to "S6,SW"
0014          F5542528.Insert
0015       End If
0016       Do Custom Section(RS F5541261 - All Fields)
0017    Else
0018    End If
0019 End If

=======================================================================
     SECTION: Union F4211 & F42119 -All Fields [GROUP SECTION] (S3)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Set Selection Append Flag()
0002 Set User Selection(BC Document (Order No, Invoice, etc.) (F4211)(DOCO), , VA rpt_DocumentOrderInvoiceE, )
0003 ! Set User Selection(BC Document Company (F4211)(KCO), , VA rpt_CompanyKeyOrderNo, )
0004 Set User Selection(BC Status Code - Last (F4211)(LTTR), , "980", )
0005 Set User Selection(BC Status Code - Next (F4211)(NXTR), , "540", )
0006 Set User Selection(BC Line Type (F4211)(LNTY), , "S", )
0007 Set User Selection(BC Line Number (F4211)(LNID), , VA rpt_LineNumberDetail, )
0008 Set User Selection(BC Order Type (F4211)(DCTO), , VA rpt_OrderType, )

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     evt_WriteYesOrNoEntry_YN
     OPT: Using Defaults
0002 Hide Section
0003 RV SplIns = "."
0004 VA rpt_VariableLengthField1_VAR1 = ""
0005 VA rpt_CountTeamId_CTAN = "999"
0008 If VA rpt_CallDetailWO_CF is equal to "99999"
0009 Else
0011    F5541251.Fetch Single
0012    RV ConfCode = VA rpt_GroupUnitOfMeasure
0015    RV ItemWtUnit = "L"
0017 End If
0020 RV ReqDelDate = BC Date - Promised Delivery (F4211)(RSDJ)
0021 RV Line_ID = [BC Line Number (F4211)(LNID)]*1000
0024 RV New_No_ofPallets = ([BC Units - Order/Transaction Quantity (F4211)(UORG)]/[RV ItemPack])/[RV CountPallet]
0028 RV ShipQty = [VA rpt_Qty_ship_C1]
0030 F5542324.Fetch Single
0031 ! F5542324.Fetch Single
0032 If SV File_IO_Status is equal to CO SUCCESS
0033    VA rpt_CountTeamId_CTAN = 1
0034    Suppress Section Write
0035 Else
0036    F554247T.Fetch Single
0037    If SV File_IO_Status is equal to CO SUCCESS
0038       F5542324.Insert
0039       VA rpt_CountLineNumberTot = [VA rpt_CountLineNumberTot]+[VA rpt_CountLineNumber]
0040    End If
0041 End If
0042 ! Add a Carrige Return to String
0043 ! Add a Carrige Return to String
0046 VA rpt_GroupUnitOfMeasureH1 = ""
0047 VA rpt_GroupUnitOfMeasureH2 = ""
0048 VA rpt_GroupUnitOfMeasureH3 = ""
0052 F554247T.Fetch Single
0053 If SV File_IO_Status is equal to CO SUCCESS
0054 Else
0055    VA rpt_CountTeamId_CTAN = 1
0056    Suppress Section Write
0057 End If
0060 F5541261.Fetch Single
0061 If SV File_IO_Status is equal to CO SUCCESS
0063    If VA rpt_QuantityTimeSeries01 is equal to And VA rpt_QuantityTimeSeries02 is equal to And VA rpt_QuantityTimeSeries03 is equal to
0064       VA rpt_CountTeamId_CTAN = 1
0065       Suppress Section Write
0066    Else
0067    End If
0068 Else
0069    VA rpt_CountTeamId_CTAN = 1
0070    Suppress Section Write
0071 End If
0074 F4102.Fetch Single
0075 RC 70 = VA rpt_ShippingConditionsCode_1
0076 If VA rpt_ShippingConditionsCode_1 is equal to "85"
0077    RC N = "Y"
0078 Else
0079 End If
0081 If VA rpt_CountTeamId_CTAN is equal to "999"
0083    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"D,xxxxxx,")
0085    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Document (Order No, Invoice, etc.) (F4211)(DOCO)],' '),' '),","))
0087    VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Line_ID],' '),' '),","))
0090    If RV ShipQty is not equal to
0091 !       Replace Character in String
0092       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ShipQty],' '),' '),","))
0093    Else
0094       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0095    End If
0098    If RV ShipQty is not equal to
0099 !       Replace Character in String
0100       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RC EA],' '),' '),","))
0101    Else
0102       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0103    End If
0105    If RV UPCcode is not equal to
0106       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV UPCcode],' '),' '),","))
0107    Else
0108       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0109    End If
0111    If BC 2nd Item Number (F4211)(LITM) is not equal to
0112       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC 2nd Item Number (F4211)(LITM)],' '),' '),","))
0113    Else
0114       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0115    End If
0117    If BC Description (F4211)(DSC1) is not equal to
0118       Replace Character in String
0119       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([BC Description (F4211)(DSC1)],' '),' '),","))
0120    Else
0121       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0122    End If
0125    If RV ProdColor is not equal to
0126       Replace Character in String
0127       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ProdColor],' '),' '),","))
0128    Else
0129       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0130    End If
0132    If RV ProdColor is not equal to
0133 !       Replace Character in String
0134       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RC 70],' '),' '),","))
0135    Else
0136       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0137    End If
0140    If RV ItemPack is not equal to
0141 !       Replace Character in String
0142       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemPack],' '),' '),","))
0143    Else
0144       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0145    End If
0147    If RV ItemNonWeight is not equal to
0148 !       Replace Character in String
0149       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemNonWeight],' '),' '),","))
0150    Else
0151       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0152    End If
0154    If RV ItemWtUnit is not equal to
0155 !       Replace Character in String
0156       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemWtUnit],' '),' '),","))
0157    Else
0158       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0159    End If
0162    If RV CountPallet is not equal to
0163 !       Replace Character in String
0164       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV CountPallet],' '),' '),","))
0165    Else
0166       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0167    End If
0170    If RV ItemWidth is not equal to
0171 !       Replace Character in String
0172       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemWidth],' '),' '),","))
0173    Else
0174       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0175    End If
0177    If RV ItemHt is not equal to
0178       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemHt],' '),' '),","))
0179    Else
0180       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0181    End If
0184    If RV ItemDepth is not equal to
0185       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ItemDepth],' '),' '),","))
0186    Else
0187       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0188    End If
0190    If RC N is not equal to
0191       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RC N],' '),' '),","))
0192    Else
0193       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0194    End If
0196    If RV New_No_ofPallets is not equal to
0197       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV New_No_ofPallets],' '),' '),","))
0198    Else
0199       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0200    End If
0202    If RV ConfCode is not equal to
0203       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ConfCode],' '),' '),","))
0204    Else
0205       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0206    End If
0208    If RV High is not equal to
0209       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV High],' '),' '),","))
0210    Else
0211       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0212    End If
0214    If RV Tie is not equal to
0215       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV Tie],' '),' '),","))
0216    Else
0217       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0218    End If
0220    If RV ContainerNo is not equal to
0221       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV ContainerNo],' '),' '),","))
0222    Else
0223       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0224    End If
0226    If RV R1 is not equal to
0227       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV R1],' '),' '),","))
0228    Else
0229       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0230    End If
0232    If RV R2 is not equal to
0233       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV R2],' '),' '),","))
0234    Else
0235       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0236    End If
0238    If RV SplIns is not equal to
0239       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim([RV SplIns],' '),' '),","))
0240    Else
0241       VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],concat(ltrim(rtrim(" ",' '),' '),","))
0242    End If
0253    Write One Line To Flat File
0254 End If

=======================================================================
     SECTION: F5541261 - All Fields [GROUP SECTION] (S9)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Initialize Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Clear User Selection
0002 Set Selection Append Flag()
0003 Set User Selection(BC Document (Order No, Invoice, etc.) (F5541261)(DOCO), , VA rpt_DocumentOrderInvoiceE, )
0004 ! Set User Selection(BC Order Company (Order Number) (F5541261)(KCOO), , VA rpt_CompanyKeyOrderNo, )
0005 Set User Selection(BC Order Type (F5541261)(DCTO), , VA rpt_OrderType, )

-----------------------------------------------------------------------
     EVENT:  Do Section
-----------------------------------------------------------------------
     evt_UnitsQuantityShipped
     OPT: Using Defaults
0004 VA rpt_LineNumberDetail = 0
0005 VA rpt_GroupUnitOfMeasure = ""
0006 VA rpt_Qty_ship_C1 = 0
0007 ! VA rpt_Qty_ship_C2 = 0
0008 ! VA rpt_Qty_ship_C3 = 0
0010 VA rpt_LineNumberDetail = BC Line Number (F5541261)(LNID)
0011 ! If BC Quantity - Time Series 01 (F5541261)(QT01E1) is not equal to And BC Quantity - Time Series 01 (F5541261)(QT01E1) is not equal to
0012    If BC Group - Unit of Measure (Level 1) (F5541261)(UGL1) is not equal to
0013       VA rpt_GroupUnitOfMeasure = ""
0014       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 1) (F5541261)(UGL1)]
0015       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 01 (F5541261)(QT01E1)]
0016       Do Custom Section(RS Union F4211 & F42119 -All Fields)
0017    End If
0018 ! End If
0019 ! If BC Quantity - Time Series 02 (F5541261)(QT02E1) is not equal to And BC Quantity - Time Series 02 (F5541261)(QT02E1) is equal to
0020    If BC Group - Unit of Measure (Level 2) (F5541261)(UGL2) is not equal to
0021       VA rpt_GroupUnitOfMeasure = ""
0022       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 2) (F5541261)(UGL2)]
0023       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 02 (F5541261)(QT02E1)]
0024       Do Custom Section(RS Union F4211 & F42119 -All Fields)
0025    End If
0026 ! End If
0027 ! If BC Quantity - Time Series 03 (F5541261)(QT03E1) is not equal to And BC Quantity - Time Series 03 (F5541261)(QT03E1) is not equal to
0028    If BC Group - Unit of Measure (Level 3) (F5541261)(UGL3) is not equal to
0029       VA rpt_GroupUnitOfMeasure = ""
0030       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 3) (F5541261)(UGL3)]
0031       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 03 (F5541261)(QT03E1)]
0032       Do Custom Section(RS Union F4211 & F42119 -All Fields)
0033    End If
0034 ! End If

=======================================================================
     SECTION: Report Header [REPORT HEADER] (S10)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0002 ! PO FileLocation = concat(concat(concat(rtrim([PO FileLocation],' '),concat("-",[SL DateToday])),concat("-",[VA rpt_TimeLastUpdated])),".csv")
0003 VA rpt_FileName_AA114 = concat(concat(concat(rtrim([PO FileLocation],' '),concat("-",[VA rpt_FileDate_AA15])),concat("-",[VA rpt_TimeLastUpdated])),".csv")
0004 ! VA rpt_FileName_AA114 = concat(concat(concat(rtrim([PO FileLocation],' '),concat("-",[SL DateToday])),concat("-",[VA rpt_TimeLastUpdated])),".csv")
0005 RV FilelocationName = concat("File Location :-    ",[VA rpt_FileName_AA114])
0007 ! Hide Section
0008 Hide Object(RC Sales Order)
0009 Hide Object(RC xxxxxx)
0010 Hide Object(RC CC01)
0011 Hide Object(RV RrunTime)
0012 Hide Object(RV RepDate)
0014 RV RepDate = [SL DateToday]
0015 RV RrunTime = [VA rpt_TimeLastUpdated]
0016 Open Flat File
0017 ! Open Flat File
0019 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"CC01,")
0020 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"xxxxxx,")
0021 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],"Sales Order,")
0023 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV RepDate])
0025 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],",")
0026 VA rpt_VariableLengthField1_VAR1 = concat([VA rpt_VariableLengthField1_VAR1],[RV RrunTime])
0028 Write One Line To Flat File
0031 ! Close Flat File
0032 ! Stop Section Processing

-----------------------------------------------------------------------
     EVENT:  Initialize Report Header
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Get Audit Information
0002 VA rpt_FileDate_AA15 = concat(concat(date_month(date_today()),date_day(date_today())),date_year(date_today()))
0004 VA rpt_VariableLengthField1_VAR1 = ""

=======================================================================
     SECTION: Report Footer [REPORT FOOTER] (S11)
=======================================================================
     OBJECT:  SECTION
     EVENT:  Do Section
-----------------------------------------------------------------------
     OPT: Using Defaults
0001 Hide Section
0003 RV TotRec = VA rpt_CountLineNumberTot
0005 VA rpt_VariableLengthField1_VAR1 = concat("CC99,",[RV TotRec])
0008 Write One Line To Flat File
0009 Close Flat File

Thursday August 10, 2017  08:54