Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

In Loop how to move condition type data

Hello Experts,

In loop while i am collecting data in final loop,

I have different pack sizes in pricing procedures viz. p10kg,

p20kg., p15kg.....like wise along with BED, EDU CESS,

Sec & High & VAT . i have fetch data from KONV.

for this i have written two select queries for pack size only in it_konv and other for taxes in it_konv1.

now, for one item no. i have three pack sizes 10, 20 40.

see the following.

FORM GET_ITEM.

DATA: QUANT TYPE KONV-KWERT.

CLEAR QUANT.

CLEAR WA_FINAL-BEDTX.

CLEAR WA_FINAL-EDUTX.

CLEAR WA_FINAL-SECTX.

CLEAR WA_FINAL-VATTX.

LOOP AT IT_VBRK INTO WA_VBRK.

WA_FINAL-VBELN = WA_VBRK-VBELN.

WA_FINAL-FKDAT = WA_VBRK-FKDAT.

WA_FINAL-KUNAG = WA_VBRK-KUNAG.

READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_VBRK-KUNAG.

WA_FINAL-ADRNR = WA_KNA1-ADRNR.

READ TABLE IT_ADRC INTO WA_ADRC WITH KEY ADDRNUMBER = WA_KNA1-ADRNR.

WA_FINAL-NAME1 = WA_ADRC-NAME1.

WA_FINAL-STREET = WA_ADRC-STREET.

WA_FINAL-STRET1 = wa_adrc-STR_SUPPL1.

WA_FINAL-STRET2 = WA_ADRC-STR_SUPPL2.

WA_FINAL-CITY1 = WA_ADRC-MC_CITY1.

WA_FINAL-POSTAL = WA_ADRC-POST_CODE1.

WA_FINAL-TIMEZ = WA_ADRC-TIME_ZONE.

LOOP AT IT_VBRP INTO WA_VBRP WHERE VBELN = WA_VBRK-VBELN.

WA_FINAL-ITEM = WA_VBRP-POSNR.

WA_FINAL-SALQT = WA_VBRP-FKIMG.

WA_FINAL-SALUN = WA_VBRP-VRKME.

WA_FINAL-MATNR = WA_VBRP-MATNR.

WA_FINAL-DESCP = WA_VBRP-ARKTX.

WA_FINAL-ORDNO = WA_VBRP-AUBEL.

LOOP AT IT_KONV INTO WA_KONV WHERE KNUMV = WA_VBRK-KNUMV.

WA_FINAL-PACKSZ = WA_KONV-KSCHL.

WA_FINAL-EXVALUE = WA_KONV-KWERT.

*

  • WRITE : / WA_FINAL-PACKSZ,

  • WA_FINAL-EXVALUE.

LOOP AT IT_KONV1 INTO WA_KONV1 WHERE KNUMV = WA_VBRK-KNUMV.

IF SY-SUBRC = 0.

IF WA_KONV1-KSCHL = 'JEXP' .

WA_FINAL-BEDTX = WA_KONV1-KWERT.

ELSEIF WA_KONV1-KSCHL = 'JECS'.

WA_FINAL-EDUTX = WA_KONV1-KWERT.

ELSEIF WA_KONV1-KSCHL = 'JA1X'.

WA_FINAL-SECTX = WA_KONV1-KWERT.

ELSEIF WA_KONV1-KSCHL = 'JIVP'.

WA_FINAL-VATTX = WA_KONV1-KWERT.

ENDIF.

ENDIF.

ENDLOOP.

ENDLOOP.

ENDLOOP.

APPEND WA_FINAL TO IT_FINAL.

ENDLOOP.

ENDFORM.

plz experts giv me solution.

Thaanks In Advance,

Ashish.

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question