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

Regarding Incompletion Log in VA01 using ABAP Code

Former Member
0 Likes
1,691

Hi All,

I have a requirement to capture the Incompletion log in VA01 ( viewed as VA01 -> Edit -> Incompletion Log ) through ABAP Coding.

I have used the Function Module BAPI_SALESORDER_CREATEFROMDAT1 to create a sales order ( which internally calls VA01 ).

Is there any method to display the incompletion log using this function module or using ABAP Coding.

Please advise. I have searched a lot on this issue but not able to get any fruitful solution.

Thanks & Regards,

Bhavika

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,428

Hi

I guess you can capture the error in return parameter as far as incompletion log is concerned please look in details into the tables parameters.

Regards

Nabheet Madan

8 REPLIES 8
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,429

Hi

I guess you can capture the error in return parameter as far as incompletion log is concerned please look in details into the tables parameters.

Regards

Nabheet Madan

Read only

david_lees
Product and Topic Expert
Product and Topic Expert
1,428

Hi,

The incompletion log is not returned from this BAPI however you can select the incompletion log data by going to table VBUV and using the order number / other key fields.

Regards, David

Read only

0 Likes
1,428

Hi David,

I have tried fetching data from Table VBUV in my code.

When i am running the in debug mode, the data is getting fetched from VBUV but when the report is not run in debug mode, the select statement for VBUV is not giving any data.

Pls find the Select statement used in my code :

SELECT *

FROM VBUV

INTO TABLE IT_VBUV

WHERE VBELN IN WV_SDOC.

Pls suggest.

Thanks in advance,

Bhavika

Read only

david_lees
Product and Topic Expert
Product and Topic Expert
0 Likes
1,428

Hi Bhavika,

Unfortunately without seeing your entire program and the parameters with which you are running it with Iu2019m not able to give you an exact answer. If data is being selected from VBUV in debug but then disappearing it suggests that either your internal table IT_VBUV is a local data object and not globally declared or it is being refreshed further on in the program.

I would check where IT_VBUV is declared and where you are analysing it from e.g. within the same program, function group or from one object to another.

Kind regards, David

Read only

0 Likes
1,428

Dear David,

Just now i have observed while debugging that the select statement is not fetching data for the particular order created but if i select for all the previous orders, it is showing them all except for the current order created. I think there is some delay in the updation of table VBUV.

Below is the part of the code,

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'

EXPORTING

ORDER_HEADER_IN = L_HEADER

IMPORTING

SALESDOCUMENT = L_SALESDOCUMENT

RETURN = L_RETURN

TABLES

ORDER_ITEMS_IN = I_ITEMS

ORDER_PARTNERS = I_PARTNERS.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = '4'.

IF L_SALESDOCUMENT IS INITIAL.

MESSAGE E028 WITH L_RETURN-MESSAGE.

ELSE.

WV_SDOC-LOW = L_SALESDOCUMENT.

WV_SDOC-HIGH = L_SALESDOCUMENT.

WV_SDOC-SIGN = 'I'.

WV_SDOC-OPTION = 'EQ'.

APPEND WV_SDOC.

CLEAR WV_SDOC.

IF IT_VBUV[] IS INITIAL.

SELECT *

FROM VBUV

INTO TABLE IT_VBUV

WHERE VBELN IN WV_SDOC.

ENDIF.

LOOP AT IT_VBUV.

IF IT_VBUV-VBELN = L_SALESDOCUMENT.

CALL FUNCTION 'TB_DATAELEMENT_GET_TEXTS'

EXPORTING

NAME = IT_VBUV-FDNAM

IMPORTING

DESCRIPTION = WV_DESCRIPTION

TEXT_LONG = WV_TEXT.

IF WV_LOG_TEXT IS INITIAL.

CONCATENATE TEXT-003 ':' WV_TEXT INTO WV_LOG_TEXT.

CLEAR : WV_DESCRIPTION,

WV_TEXT.

ELSE.

CONCATENATE WV_LOG_TEXT ',' WV_TEXT INTO WV_LOG_TEXT.

CLEAR : WV_DESCRIPTION,

WV_TEXT.

ENDIF.

ENDIF.

CLEAR IT_VBUV.

ENDLOOP.

Please advise.

Thanks in Advance,

Bhavika

Read only

david_lees
Product and Topic Expert
Product and Topic Expert
0 Likes
1,428

Hi Bhavika,

It is a common issue, usually more so if you are calling one BAPI after another and the subsequent BAPI is dependent upon the first. If you require the VBUV data immediately after the BAPI then your only solution is to use the WAIT up to u2026 statement. Be very careful using this however. If orders are created all ok and with no missing data then you wonu2019t have any entries in the VBUV as by its very nature the order wonu2019t be u2018incompleteu2019.

Are you expecting for the order to always be incomplete? If so then WAIT is your only option else alternatively and perhaps a better approach would be to just interpret the RETURN table from the BAPI for errors or select data from VBUV later on when it is required and everything has been saved.

Kind regards, David

Ps the WAIT parameter in BAPI_TRANSACTION_COMMIT is just a flag, youu2019ve got a u20184u2019 in your code

Read only

0 Likes
1,428

Dear David,

My Problem is solved. Thanks for your quick replies and providing me with the solutions.

Best Regards,

Bhavika

Read only

0 Likes
1,428

Hi,

Instead of using WAIT use 'SET UPDATE TASK LOCAL' before call the create bapi.. much less uncool