Skip to Content
0
Former Member
Jun 07, 2007 at 05:01 PM

at end of

15 Views

Hi every one,

will anybody let you know why this code is not working

where vbeln = gt_vttp-vbeln.

select-options : s_tknum for vttp-tknum.

SELECT tknum vbeln FROM vttp INTO TABLE gt_vttp

WHERE tknum in s_tknum.

SELECT vbeln kunnr btgew FROM likp INTO TABLE gt_likp

FOR ALL ENTRIES IN gt_vttp

WHERE vbeln = gt_vttp-vbeln.

SELECT kunnr adrnr FROM kna1 INTO TABLE gt_ship_add

FOR ALL ENTRIES IN gt_likp

WHERE kunnr = gt_likp-kunnr.

SELECT addrnumber name1 street city1 country FROM adrc

INTO TABLE gt_add

FOR ALL ENTRIES IN gt_ship_add

WHERE addrnumber = gt_ship_add-adrnr.

SORT gt_likp BY kunnr.

  • SORT gt_ship_add BY kunnr.

LOOP AT gt_likp INTO gs_likp.

  • READ TABLE gt_ship_add INTO gs_ship_add

  • WITH KEY kunnr = gs_likp-kunnr BINARY SEARCH.

  • READ TABLE gt_add INTO gs_add

  • WITH KEY addrnumber = gs_ship_add-adrnr BINARY SEARCH.

  • gs_ship-kunnr = gs_likp-kunnr.

  • gs_ship-vbeln = gs_likp-kunnr.

ADD 1 TO gv_rolls.

ADD gs_likp-btgew TO gv_tot.

AT END OF kunnr.

  • gs_ship1-name1 = gs_add-name1.

  • gs_ship1-street = gs_add-street.

  • gs_ship1-city1 = gs_add-city1.

  • gs_ship1-country = gs_add-country.

MOVE gv_rolls TO gs_ship1-rolls.

gs_ship1-kunnr = gs_likp-kunnr.

gs_ship1-btgew = gv_tot.

APPEND gs_ship1 TO gt_ship1.

  • CLEAR:gv_tot,gv_rolls.

append gs_ship to gt_ship.

ENDAT.

ENDLOOP.

Please anybody solve this problem

regards,