Application Development 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: 

Problem in FBV2 BDC

former_member420878
Active Participant
0 Kudos


Hi All,

I am changing parked documents and making them in save as complete status.

My program is :

loop on records

call transaction 'FV75' for parking.

if parking is done then

call transaction 'FBV2' for save as complete.

   if error return error

endloop.

Input
rec 1
rec 2
rec 3
rec 4

Expected output

Parked documentError MessageStatus
1234567890account X requires an CO assignmenterror in Save as complete
Customer A is not definederror in Parking
1234567891Save as complete
1234567892Save as complete

Actual Output

Parked documentError MessageStatus
1234567890account X requires an CO assignmenterror in Save as complete
Field INVFO-WAERS 1. 2 is not an input fielderror in Parking
Field INVFO-WAERS 1. 2 is not an input fielderror in Parking
Field INVFO-WAERS 1. 2 is not an input fielderror in Parking

If I am running my report with in same session then parked document is getting stuck into FBV2 session and hence when I am going for next record parking, it is opening the last parked document in change mode. As a result for all subsequent records it is giving error ' Field INVFO-WAERS 1. 2 is not an input field'.

please find recording for FBV2

      IF lv_xwffr EQ lc_x. " WF is getting triggered for posting
      PERFORM bdc_dynpro      USING 'SAPMF05V'         '0100'.
      PERFORM bdc_field       USING 'BDC_CURSOR'       'RF05V-BUKRS'.
      PERFORM bdc_field       USING 'BDC_OKCODE'       '/00'.
      PERFORM bdc_field       USING 'RF05V-BUKRS'      lc_ABC.
      PERFORM bdc_field       USING 'RF05V-BELNR'      lv_belnr.
      PERFORM bdc_field       USING 'RF05V-GJAHR'      gv_curry.
      PERFORM bdc_dynpro      USING 'SAPMF05A'         '1200'.
      PERFORM bdc_field       USING 'BDC_OKCODE'       '=PBBP'.
      PERFORM bdc_dynpro      USING 'SAPMF05A'         '1200'.
      PERFORM bdc_field       USING 'BDC_OKCODE'       '/n'.
      PERFORM bdc_field       USING 'BDC_OKCODE'       '/EEND'.
      PERFORM bdc_dynpro      USING 'SAPLSPO1'         '0200'.
      PERFORM bdc_field       USING 'BDC_OKCODE'       '=YES'.

Please suggest me if I am doing any thing wrong.. I am not able to find.

Thanks in advance.

1 ACCEPTED SOLUTION

former_member420878
Active Participant
0 Kudos

Problem solved.

Way around : Now first Im doing all record parking and then in different loop, I am doing save as complete and hence it is working fine.

But Im still wondering is that the problem with SAP .

4 REPLIES 4

Former Member
0 Kudos

Hi Neha,

You can get the message from sy-msgid, sy-msgty, sy-msgno, sy-msgv1&2&3&4, once you finished FV75, in those messages, you can get the document number.

Then 'SET parameter' for document and company code before you call FBV2.

regards,

Archer

former_member289261
Active Contributor
0 Kudos

You are trying to assign value to field INVFO-WAERS. But this field is pre-populated and is disabled for changes therefore the error.

Please comment the code for the value assignment to this field.

Code would be like this :

PERFORM bdc_field       USING 'INVFO-WAERS'      some_variable.


Please comment out OR remove this line of code.



Regards,

Ashish

0 Kudos

Thanks for the reply Ashish, but my problem is different.

1st record is in error at the time of save as complete and BDC returns the error, but parked document is still opened in FBV2 tcode at backend. - (that is how SAP is behaving, as per my assumption)

now for second record - at the time of parking system is going for change in already opened document instead of creating new one.

hence throwing me error for next coming records.

Please let me know if the sitution is not clear.

Thanks.

former_member420878
Active Participant
0 Kudos

Problem solved.

Way around : Now first Im doing all record parking and then in different loop, I am doing save as complete and hence it is working fine.

But Im still wondering is that the problem with SAP .