2012 Dec 15 12:59 PM
Hi Experts
'm new in abap kindly help me to write the syntax of step 5.(looping of itab only).
Pseudo Code:
STEP 1.( Retrieving all the Billing Documents based on the selection screen parameters)
Billing Type (FKART), Billing category (FKTYP),SD document category (VBTYP),SD document currency (WAERK),Sales Organization (VKORG),Billing Date (FKDAT),Net value in document currency (NETWR)From the table VBRK into the internal table T_VBRK against the Sales organization (P_VKORG), Billing date (S_FKDAT), Billing type (S_FKART) entered in the selection screen.
STEP 2. (Retrieving all the Bill to Parties against the Document Numbers)
Bill to Parties (KUNNR), Partner Functions (PAEVW)from the table VBPA into an internal table T_VBPA for all entries in the internal table T_VBRK, against the Document numbers (S_VBELN), Customer (S_KUNNR) entered in the selection screen, and the Document category = C_S_RE (‘RE’)
Sort the internal table T_VBPA by Document Number (VBELN) and Customer (KUNNR). STEP 3. (Retrieving all the Bill to Party Description)
Customer Name (NAME1) From KNA1 into the internal table T_KNA1 for all entries in he internal table T_VBPA against the KUNNR equal to T_VBPA-KUNNR.
Sort the internal table T_KNA1 by Customer (KUNNR). STEP 4. (Retrieving all the Billing Document Type Text)
Billing document text (VTEXT) From TVFKT into the internal table T_TVFKT for all the entries in the internal table T_VBRK against the billing type of T_VBRK-FKART.
STEP 5.( Gather all the selected Data for further calculation)
Ø While looping at this table (T_VBRK_VBPA) read the internal table T_VBPA to get the Bill to party and move it to the internal table T_VBRK_VBPA.
Item Number (POSNR),Quantity (FKIMG),Units of Measurement (MEINS)Net value (NETWR),Material Number (MATNR) Material description (ARKTX) From VBRP into the internal table T_VBRP for all the entries in the internal table T_VBRK_VBPA and the material entered in the selection screen (S_MATNR).
Sort the internal table T_VBRP by Document Number (VBELN).
Regards
Goutam
2012 Dec 15 4:46 PM
Hi,
LOOP AT t_vbrk INTO wa_vbrk.
READ TABLE t_vbpa INTO wa_vbpa WITH KEY (write your conditons here).
wa_vbrk_vbpa-bill_to_party = wa_vbpa-bill_to_party.
READ TABLE t_kna1 INTO wa_kna1 WITH KEY kunnr = wa_vbrk-kunnr.
wa_vbrk_vbpa-bill_toparty_descr = wa_kna1-biltoparty_descr.
APPEND wa_vbrk_vbpa TO t_vbrk_vbpa.
ENDLOOP.
Look here and based on this do the looping. You have the better idea of the fields you require. Refer this for syntax of how to do it.
hope this helps.
2012 Dec 15 4:46 PM
Hi,
LOOP AT t_vbrk INTO wa_vbrk.
READ TABLE t_vbpa INTO wa_vbpa WITH KEY (write your conditons here).
wa_vbrk_vbpa-bill_to_party = wa_vbpa-bill_to_party.
READ TABLE t_kna1 INTO wa_kna1 WITH KEY kunnr = wa_vbrk-kunnr.
wa_vbrk_vbpa-bill_toparty_descr = wa_kna1-biltoparty_descr.
APPEND wa_vbrk_vbpa TO t_vbrk_vbpa.
ENDLOOP.
Look here and based on this do the looping. You have the better idea of the fields you require. Refer this for syntax of how to do it.
hope this helps.
2012 Dec 16 4:08 AM