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

issue with FM FI_document_change in Loop

Former Member
0 Likes
793

Hello Expoert,

I am using FM this in a custom program to unblock the FI and MM invoice. My problem is this work fine if no of invoice are less than 500 if no of invoices are more than 500 program execute properly but few invoice are not unblocked while the sy-subrc = 0 I applied a counter on this value. I means if sy-subrc = 0 increase counter invoice unblocked by 1.

I cross check this by debug. When I check the custom program by debug for each invoice its work fine but when I execute it directly there is problem.

My Code :

it_accchg-fdname = 'ZLSPR '.

it_accchg-oldval = 'A'.

it_accchg-newval = ' '.

APPEND it_accchg.

break marotd.

CALL FUNCTION 'FI_DOCUMENT_CHANGE'

EXPORTING

i_awtyp = l_awtyp

i_awref = l_awref

i_aworg = l_aworg

i_lifnr = bseg-lifnr

TABLES

t_accchg = it_accchg

EXCEPTIONS

no_reference = 1

no_document = 2

many_documents = 3

overwrite_creditcard = 4

OTHERS = 5.

IF sy-subrc = 0.

ADD 1 TO w_unbl_mm.

ELSE.

ADD 1 TO w_unkw_mm.

MOVE-CORRESPONDING s_file TO it_zbbt004.

APPEND it_zbbt004.

ADD 1 TO cnt_records_transfered.

ADD 1 TO w_insr_mm.

no = 'X'.

ENDIF.

Please suggest.

Regards

Swati Namdev

Hello Expoert,

I am using FM this in a custom program to unblock the FI and MM invoice. My problem is this work fine if no of invoice are less than 500 if no of invoices are more than 500 program execute properly but few invoice are not unblocked while the sy-subrc = 0 I applied a counter on this value. I means if sy-subrc = 0 increase counter invoice unblocked by 1.

I cross check this by debug. When I check the custom program by debug for each invoice its work fine but when I execute it directly there is problem.

My Code :

it_accchg-fdname = 'ZLSPR '.

it_accchg-oldval = 'A'.

it_accchg-newval = ' '.

APPEND it_accchg.

break marotd.

CALL FUNCTION 'FI_DOCUMENT_CHANGE'

EXPORTING

i_awtyp = l_awtyp

i_awref = l_awref

i_aworg = l_aworg

i_lifnr = bseg-lifnr

TABLES

t_accchg = it_accchg

EXCEPTIONS

no_reference = 1

no_document = 2

many_documents = 3

overwrite_creditcard = 4

OTHERS = 5.

IF sy-subrc = 0.

ADD 1 TO w_unbl_mm.

ELSE.

ADD 1 TO w_unkw_mm.

MOVE-CORRESPONDING s_file TO it_zbbt004.

APPEND it_zbbt004.

ADD 1 TO cnt_records_transfered.

ADD 1 TO w_insr_mm.

no = 'X'.

ENDIF.

Please suggest.

Regards

Swati Namdev

1 REPLY 1
Read only

Former Member
0 Likes
558

Problem with invoice....they are lock for change.....