‎2007 Jun 22 10:37 AM
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
‎2007 Jun 25 10:50 AM
problem solved by myself, by using additional function modules and bapi's
‎2007 Jun 22 10:46 AM
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
‎2007 Jun 22 10:49 AM
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
‎2007 Jun 22 11:09 AM
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
‎2007 Jun 22 10:49 AM
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.
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
‎2007 Jun 22 11:00 AM
@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
‎2007 Jun 25 10:50 AM
problem solved by myself, by using additional function modules and bapi's
‎2007 Aug 06 4:35 PM
Hi Hans,
How did you solved the problem?
Can you explain.
Regards,
Kate
‎2007 Aug 07 7:10 AM
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