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

Problem in create billing document thr VF01

Former Member
0 Likes
2,500

Hi,

I create a billing document for the delivery order number using VF01 through BDC batch input session. Here is the program flow,

1. perform open_bdc.

2. perform populate_bdc_data.

3. perform insert_bdc_session.

4. perform call_transaction_using_VF01 - only to capture return error messages.

5. perform event_trigger - trigger an event which starts a job that is defined to run when the event is raised. The job will execute the RSBDCSUB.

6. perform close_bdc.

7. perform process_bdc - process the bdc session through

SUBMIT RSBDCSUB.

My problem is, when creating billing document, the program not able to capture the return error message if there is any error occurs. The message tab (after CALL TRANSACTION) gives error message with message type as 'S'. so the program was not able to capture/display error records.

Is there any way to capture the return error message correctly?

Or Any suitable BAPI available?

Pl help me to sort out the issue.

Thanks in advance.

Hi,

I create a billing document for the delivery order number using VF01 through BDC batch input session. Here is the program flow,

1. perform open_bdc.

2. perform populate_bdc_data.

3. perform insert_bdc_session.

4. perform call_transaction_using_VF01 - only to capture return error messages.

5. perform event_trigger - trigger an event which starts a job that is defined to run when the event is raised. The job will execute the RSBDCSUB.

6. perform close_bdc.

7. perform process_bdc - process the bdc session through

SUBMIT RSBDCSUB.

My problem is, when creating billing document, the program not able to capture the return error message if there is any error occurs. The message tab (after CALL TRANSACTION) gives error message with message type as 'S'. so the program was not able to capture/display error records.

Is there any way to capture the return error message correctly?

Or Any suitable BAPI available?

Pl help me to sort out the issue.

Thanks in advance.

8 REPLIES 8
Read only

Former Member
0 Likes
1,657

use format_meessage

CALL TRANSACTION 'PA30' USING IT_BDCDATA MODE 'A'

UPDATE 'S'

<b>MESSAGES INTO IT_MSG.</b>

LOOP AT IT_MSG WHERE MSGTYP = 'E' .

PERFORM CREATE_SESSION.

PERFORM INSERT_INTO_SESSION.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = IT_MSG-MSGID

LANG = SY-LANGU

NO = IT_MSG-MSGNR

V1 = IT_MSG-MSGV1

V2 = IT_MSG-MSGV2

V3 = IT_MSG-MSGV3

V4 = IT_MSG-MSGV4

IMPORTING

MSG = V_MSG

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

plz reward if useful

Read only

Former Member
0 Likes
1,657

Hi,

you can try with <b>GN_INVOICE_CREATE</b>, generally this is used to create invoices.

Regards

vijay

Read only

0 Likes
1,657

hi

WELCOME TO SDN

Use<b> Format_message</b> fm

i.e,

<b>LOOP AT IT_MSGS WHERE MSGTYP = 'E'</b> .

perform create_session.

perform insert_bdc_session.

CALL FUNCTION <b>'FORMAT_MESSAGE'</b>

EXPORTING

ID = IT_MSGS-MSGID

LANG = SY-LANGU

NO = IT_MSGS-MSGNR

V1 = IT_MSGS-MSGV1

V2 = IT_MSGS-MSGV2

V3 = IT_MSGS-MSGV3

V4 = IT_MSGS-MSGV4

IMPORTING

MSG = W_MSGS

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

<b>ENDLOOP.</b>

Read only

Former Member
0 Likes
1,657

Check these out

BAPI_BILLINGDOC_CREATE

BAPI_BILLINGDOC_CREATEFROMDATA

BAPI_BILLINGDOC_CREATEMULTIPLE

Read only

Former Member
0 Likes
1,657

Thanks for the replies.

Of course i am doing,

LOOP AT IT_MSG WHERE MSGTYP = 'E'.

CALL FUNCTION 'FORMAT_MESSAGE'

*capture the error message

ENDLOOP.

This is not my issue.

After call transaction, ff the transaction fails, there are error messages like

'billing document were not created: see log' in IT_MSG. But the MSGTYP is 'S'. That was the problem.

Since the MSGTYP is 'S', the program not able to capture the error records. I want to capture all error records and send it to recycle table to be re-processed in next batch run.

Regading BAPI_BILLINGDOC_CREATE, I tried it, it just internally execute call transaction VF01 and the returns the copy of IT_MSG(MESSAGE TAB).

Regarding GN_INVOICE_CREATE, I haven't tried. Will update you soon. will it reurn any error msg or return table.

Read only

Former Member
0 Likes
1,657

I tried with GN_INVOICE_CREATE...it doesn't work...it creates invoice based on that data but not on delivery oder...

Actually my program create invoice based on the reference delivery order number through VF01.

Is there any other FM/BAPI wich creates invoice with return status?

Read only

Former Member
0 Likes
1,657

I tried the FM: rv_invoice_create which creates Invoice for a delivery order number. It is working fine.

Anyway, thanks for your replies.

Read only

0 Likes
1,657

Hi

we are facing the same problem. We are trying to create invoice from delivery number using RV_INVOICE_CREATE but we are getting runtime error for duplicate data in VBUK table. We are trying to put some data in XVBRK-ZUONR field as well. Any help is appreciated as we don't want to use BDC for VF01.

Panchdev Sharma