05-22-2014 6:10 AM
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 document | Error Message | Status |
---|---|---|
1234567890 | account X requires an CO assignment | error in Save as complete |
Customer A is not defined | error in Parking | |
1234567891 | Save as complete | |
1234567892 | Save as complete |
Actual Output
Parked document | Error Message | Status |
---|---|---|
1234567890 | account X requires an CO assignment | error in Save as complete |
Field INVFO-WAERS 1. 2 is not an input field | error in Parking | |
Field INVFO-WAERS 1. 2 is not an input field | error in Parking | |
Field INVFO-WAERS 1. 2 is not an input field | error 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.
05-22-2014 10:47 AM
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 .
05-22-2014 6:54 AM
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
05-22-2014 7:20 AM
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
05-22-2014 7:48 AM
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.
05-22-2014 10:47 AM
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 .