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

BAPI_DELIVERYPROCESSING_EXEC with texts

h_senden2
Active Contributor
0 Likes
1,964

Hi,

how do i have to fill the input/output tables TEXT_HEADER and TEXT_LINES to create a header text for a newly created delivery by function module BAPI_DELIVERYPROCESSING_EXEC ?

I'm testing with several values and the delivery is created, but the header text not !

regards,

Hans

1 ACCEPTED SOLUTION
Read only

h_senden2
Active Contributor
0 Likes
1,350

problem solved by myself, by using additional function modules and bapi's

8 REPLIES 8
Read only

Former Member
0 Likes
1,350

Hi,

Have you tested with passing blank values in document number??

Pass with out document number to the same function module in TEXT_HEADER with required parameters, i hope it works.

Other way is,

First create document and extend with text by using the same BAPI.

Thanks,

Saida Rao

Read only

0 Likes
1,350

Hi Saida,

I can only pass blank values for the doc.number, because the docnumber is not determined yet ! And that is not working.

Anyone ?

Hans

Read only

0 Likes
1,350

Hi Hans,

Try to call the BAPI Two times,

step1: call the bapi and document created through this step you can find out return doucment through return parameters.

Commit it.

2step: call again the same bapi for to extend the same document created in step1 by passing document number and texts.

I hope it will meet your requirement.

Thanks,

Saida Rao

Read only

Former Member
0 Likes
1,350

Hi,

chk this prog which i had taken from one of previous threads

*----


REPORT ypat_create_delivery LINE-SIZE 256.

*----


  • Internal Tables

*----


  • Table to Hold Delivery Request

DATA: BEGIN OF tbl_request OCCURS 0.

INCLUDE STRUCTURE bapideliciousrequest.

DATA: END OF tbl_request.

  • Table to hold Line Items Created

DATA: BEGIN OF tbl_items OCCURS 0.

INCLUDE STRUCTURE bapideliciouscreateditems.

DATA: END OF tbl_items.

  • Table to hold BAPI Return Messages

DATA: BEGIN OF tbl_return OCCURS 0.

INCLUDE STRUCTURE bapiret2.

DATA: END OF tbl_return.

*----


  • Structures

*----


DATA: st_vbak LIKE vbak,

st_vbap LIKE vbap.

*----


  • Selection Screen

*----


PARAMETERS: p_vbeln LIKE vbak-vbeln,

p_posnr LIKE vbap-posnr DEFAULT '000010'.

*----


  • Start of Selection

*----


START-OF-SELECTION.

SELECT SINGLE *

INTO st_vbak

FROM vbak

WHERE vbeln = p_vbeln.

CHECK sy-subrc EQ 0.

SELECT SINGLE *

INTO st_vbap

FROM vbap

WHERE vbeln = p_vbeln AND

posnr = p_posnr.

----


End of Selection

*----


END-OF-SELECTION.

IF st_vbak IS INITIAL.

WRITE:/ 'Invalid Sales Order'.

EXIT.

ENDIF.

tbl_request-document_numb = st_vbap-vbeln.

tbl_request-document_item = st_vbap-posnr.

tbl_request-ship_to = st_vbak-kunnr.

tbl_request-sold_to = st_vbak-kunnr.

tbl_request-sales_organisation = st_vbak-vkorg.

tbl_request-distribution_channel = st_vbak-vtweg.

tbl_request-division = st_vbak-spart.

tbl_request-plant = st_vbap-werks.

tbl_request-quantity_sales_uom = '1'.

tbl_request-sales_unit = st_vbap-vrkme.

tbl_request-base_uom = st_vbap-meins.

tbl_request-material = st_vbap-matnr.

tbl_request-delivery_date = st_vbak-bstdk.

tbl_request-delivery_time = '160000'.

tbl_request-transp_plan_date = st_vbak-bstdk.

tbl_request-loading_date = st_vbak-bstdk.

tbl_request-goods_issue_date = st_vbak-bstdk.

tbl_request-extdelv_no = '98765'.

tbl_request-document_type = 'A'. "Delivery

tbl_request-document_type_predecessor = 'A'. "Sales Ord

tbl_request-document_type_delivery = 'LF'.

APPEND tbl_request.

CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'

TABLES

request = tbl_request

createditems = tbl_items

return = tbl_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT tbl_return.

WRITE:/ tbl_return-type,

tbl_return-id,

tbl_return-number,

tbl_return-message.

ENDLOOP.

Further info

https://forums.sdn.sap.com/click.jspa?searchID=3361518&messageID=2977359

<b>Reward points</b>

Regards

Read only

0 Likes
1,350

@skk : if you had read my question, you have see that the delivery is created correctly but the HEADER TEXTS not. In your answer you don't talk about the header text at all.

Hans

Read only

h_senden2
Active Contributor
0 Likes
1,351

problem solved by myself, by using additional function modules and bapi's

Read only

Former Member
0 Likes
1,350

Hi Hans,

How did you solved the problem?

Can you explain.

Regards,

Kate

Read only

h_senden2
Active Contributor
0 Likes
1,350

Hi,

the bapi still doesn't work. The solution was to first create the delivery and after that create the text by using the standard text function modules (INIT_TEXT, READ_TEXT, SAVE_TEXT).

regards,

Hans