The company requires the sales invoice report to be customized in order to control the printing of sales invoices. This section contains two parts; one is the technical specification, and the other one is the report development coding.
The following are the specification details. The specification details are linked with the screenshot of the customized report, which has been marked with the field number, and each of the steps in the text is identified in the screenshot. The sales analysis report's detailed technical information is as shown next:
Tables used are: F4201, F4211, F0101, and F0111. You can also create your custom business view from these tables as per the report requirement:
The coding of this report is based on the given specifications; the system generates the following code on OMW. In the Initialize Section
, you will initialize the variable, and in the Do Section
, you will do the main coding:
===================================================================== SECTION: Join Between F4201 & F4211 [GROUP SECTION] (S1) ===================================================================== OBJECT: SECTION EVENT: Do Section --------------------------------------------------------------------- evt_PriceAdjustmentType_AST evt_UserDefinedCodes_RT evt_ProductCode_SY evt_AmtPricePerUnit2_UPRC evt_FactorValue_FVTR evt_AdjustmentReasonCode_ARSN 0001 If PO PrintAttachment_FLAG is equal to "Y" 0002 Media Objects(GT4211A, <Get Text>, RV LineAttachment_DL01, BC Document (Order No, Invoice, etc.) (F4201) (DOCO), BC Order Type (F4201) (DCTO), BC Order Company (Order Number) (F4201) (KCOO), ...) 0003 Else 0004 End If 0005 // 0006 VA evt_PriceAdjustmentType_AST = "GEN" 0007 VA evt_ProductCode_SY = "40" 0008 VA evt_UserDefinedCodes_RT = "AR" 0009 ! F4074.Fetch Single ! BC Document (Order No, Invoice, etc.) (F4201) = TK Document (Order No, Invoice, etc.) ! BC Order Type (F4201) = TK Order Type ! BC Order Company (Order Number) (F4201) = TK Order Company (Order Number) ! BC Line Number (F4211) = TK Line Number ! VA evt_FactorValue_FVTR <- TK Factor Value ! VA evt_AmtPricePerUnit2_UPRC <- TK Amount - Price per Unit ! VA evt_AdjustmentReasonCode_ARSN <- TK Adjustment Reason Code 0010 RV FactorValue_FVTR = VA evt_FactorValue_FVTR*-1 0011 RV UnitPrice_UPRC = VA evt_AmtPricePerUnit2_UPRC 0012 Get UDC Description (Obsolete) VA evt_ProductCode_SY -> BF szSystemCode VA evt_UserDefinedCodes_RT -> BF szUserDefinedCodes VA evt_AdjustmentReasonCode_ARSN -> BF szUserDefinedCode RV F0005Description_DL01 <- BF szDescription01 0013 RV SubTotalAmount_AA = BC Amount - Extended Price (F4211)+RV UnitPrice_UPRC 0014 // 0015 If PO Language_FLAG is equal to "A" 0016 F4107.Fetch Single BC Item Number - Short (F4211) = TK Item Number - Short RV ItemDesc_DL01 <- TK Short Description 0017 Else 0018 RV ItemDesc_DL01 = concat(BC Description (F4211),BC Description - Line 2 (F4211)) 0019 End If