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

Open Order + VBUK + VBAP

Former Member
0 Likes
477

hi

all

Plz look at this code

i m trying to loop at VBFA table and Read VBUk table

actually i have to found the open delivery .so i m looping on table T_VBPA_TAB (bcoz for 1 order there may be multiple Delivery) and check VBTYP_N eq 'J'in T_VBFA

.now read T_VBUK to find WBSTK and get open quantity .

But it gives wrong result..my logic is correct but what i

have to put for corresponding cases.

Plz check it.

Loop at T_VBPA_tab

Loop at T_VBFA where vbelv eq T_VBPA_tab-vbeln

and posnv eq T_VBPA_tab-posnr

and vbtyp_n eq 'J' .

Read T_VBUK with key vbeln eq T_VBFA-vbeln

if sy-subrc eq 0.

case t_vbuk-wbstk.

when c_a .

w_open_qty = t_vbfa-rfmng + w_open_qty.

when c_b .

w_open_qty =T_VBAP-kwmeng - t_vbfa-rfmng+w_open_qty

when c_c.

w_open_qty = '0.000' + w_open_qty .

endcase.

endloop.

if sy-subrc ne 0.

w_open_qty = hldmatl-kwmeng.

write : W_OPEN_QTY.

endloop.

Thanks

Saurabh

hi

all

Plz look at this code

i m trying to loop at VBFA table and Read VBUk table

actually i have to found the open delivery .so i m looping on table T_VBPA_TAB (bcoz for 1 order there may be multiple Delivery) and check VBTYP_N eq 'J'in T_VBFA

.now read T_VBUK to find WBSTK and get open quantity .

But it gives wrong result..my logic is correct but what i

have to put for corresponding cases.

Plz check it.

Loop at T_VBPA_tab

Loop at T_VBFA where vbelv eq T_VBPA_tab-vbeln

and posnv eq T_VBPA_tab-posnr

and vbtyp_n eq 'J' .

Read T_VBUK with key vbeln eq T_VBFA-vbeln

if sy-subrc eq 0.

case t_vbuk-wbstk.

when c_a .

w_open_qty = t_vbfa-rfmng + w_open_qty.

when c_b .

w_open_qty =T_VBAP-kwmeng - t_vbfa-rfmng+w_open_qty

when c_c.

w_open_qty = '0.000' + w_open_qty .

endcase.

endloop.

if sy-subrc ne 0.

w_open_qty = hldmatl-kwmeng.

write : W_OPEN_QTY.

endloop.

Thanks

Saurabh

1 REPLY 1
Read only

Former Member
0 Likes
414

Hi Tiwari ,

check ur values with VA05 and table entries of KUNNR In S066/67.

Regards

Prabhu