Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sales Report

Former Member
0 Likes
379

Hi,

I have a completed sales order report..which gives overall status for a line item , but when we check the document flow of that particular sales order in va03 , the status for the delivery is not yet completed.

The status should be shown as Being processed instead of completed...tables related -- vbfa ,vbuk

My code is like this

SORT itab_display.

DELETE ADJACENT DUPLICATES from itab_display.

-


missing code----


SELECT bezei statu FROM tvbst INTO

table itab_display1

WHERE spras = 'E'

AND fdnam = 'GBSTK'

AND tbnam = 'VBUK'.

LOOP at itab_display.

CLEAR itab_display1.

READ table itab_display1 with key statu = itab_display-gbstk.

MOVE itab_display1-bezei TO itab_display-bezei .

MODIFY itab_display.

ENDLOOP.

ENDFORM. " get_the_data

thxs,

vind.

Hi,

I have a completed sales order report..which gives overall status for a line item , but when we check the document flow of that particular sales order in va03 , the status for the delivery is not yet completed.

The status should be shown as Being processed instead of completed...tables related -- vbfa ,vbuk

My code is like this

SORT itab_display.

DELETE ADJACENT DUPLICATES from itab_display.

-


missing code----


SELECT bezei statu FROM tvbst INTO

table itab_display1

WHERE spras = 'E'

AND fdnam = 'GBSTK'

AND tbnam = 'VBUK'.

LOOP at itab_display.

CLEAR itab_display1.

READ table itab_display1 with key statu = itab_display-gbstk.

MOVE itab_display1-bezei TO itab_display-bezei .

MODIFY itab_display.

ENDLOOP.

ENDFORM. " get_the_data

thxs,

vind.

1 REPLY 1
Read only

Former Member
0 Likes
346

Hi Vind,

Try to place sy-subrc check after read statement.

Change code as follows.

LOOP at itab_display.

CLEAR itab_display1.

READ table itab_display1 with key statu = itab_display-gbstk.

<b>if sy-subrc = 0.</b>

MOVE itab_display1-bezei TO itab_display-bezei .

MODIFY itab_display.

<b>endif.</b>

ENDLOOP.

<b>Otherwise,</b> You may have problem with DELETE ADJACENT DUPLICATES which may delete some wanted records from your internal table. Have a check on DELETE ADJACENT DUPLICATES statement.

Thanks,

Vinay