Help me in bapi...
hi frnds i need the code for bapi .
· to Upload the data for Schedule line items for sales order using BAPI.
plzz hlp frnds its urgent.
hi rajesh,
Please check the following code in case its a bill of material
FORM CHECK_SALES_BOM TABLES ORDER_ITEMS_IN STRUCTURE BAPIITEMIN
ORDER_PARTNERS STRUCTURE ZBAPISHIP1.
CLEAR FLAG_CANCEL_CREATE.
CLEAR V_LINES1.
LOOP AT ORDER_ITEMS_IN.
V_ITM_NUMBER = ORDER_ITEMS_IN-ITM_NUMBER.
ORDER_ITEMS_IN-PO_ITM_NO = ORDER_ITEMS_IN-ITM_NUMBER. " DEVK942749
ORDER_ITEMS_IN-ITM_NUMBER = 10 * SY-TABIX + 10 * V_LINES1.
MODIFY ORDER_ITEMS_IN.
LOOP AT ORDER_PARTNERS WHERE ITEM_NUMB = V_ITM_NUMBER.
ORDER_PARTNERS-ITEM_NUMB = ORDER_ITEMS_IN-ITM_NUMBER.
MODIFY ORDER_PARTNERS.
ENDLOOP.
SELECT SINGLE KNUMH FROM KOTD001 INTO KOTD001-KNUMH
WHERE KAPPL = 'V'
AND KSCHL = 'A001'
AND MATWA = ORDER_ITEMS_IN-MATERIAL
AND DATBI GE SY-DATUM
AND DATAB LE SY-DATUM.
IF SY-SUBRC = 0.
SELECT SINGLE SMATN FROM KONDD INTO KONDD-SMATN
WHERE KNUMH = KOTD001-KNUMH.
ORDER_ITEMS_IN-MATERIAL = KONDD-SMATN.
ELSE.
ORDER_ITEMS_IN-MATERIAL = ORDER_ITEMS_IN-MATERIAL.
ENDIF.
CLEAR V_WERKS.
SELECT SINGLE DWERK MTPOS INTO (V_WERKS, MVKE-MTPOS) FROM MVKE
WHERE MATNR = ORDER_ITEMS_IN-MATERIAL
AND VKORG = WWW_ORDER_HEADER_EXP-VKORG
AND VTWEG = WWW_ORDER_HEADER_EXP-VTWEG.
IF MVKE-MTPOS EQ 'LUMF' OR MVKE-MTPOS EQ 'ZLUM'.
READ TABLE ORDER_PARTNERS WITH KEY ITEM_NUMB = V_ITM_NUMBER
PARTN_ROLE = 'WE'.
REFRESH : DA_MASTB,
DA_STKOB,
DA_STZUB.
CALL FUNCTION 'CS_ALT_SELECT_MAT'
EXPORTING
ALL = ' '
CAPID = 'SD01'
DATUV = SY-DATUM
DIALF = ' '
LOSGR = 0
MATNR = ORDER_ITEMS_IN-MATERIAL
NOTAB = 'X'
NRFDC = ' '
STLAL = ' '
STLAN = ' '
VPRIO = ' '
WERKS = V_WERKS
TABLES
MASTB_WA = DA_MASTB
STKOB_WA = DA_STKOB
STZUB_WA = DA_STZUB
EXCEPTIONS
ALT_NOT_FOUND = 1
BOM_NOT_ACTIVE = 2
BOM_NOT_FOUND = 3
CALL_INVALID = 4
NO_ALT_FOUND = 5
NO_BOM_FOUND = 6
OTHERS = 7.
READ TABLE DA_MASTB INDEX 1.
IF SY-SUBRC = 0.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'SD01'
DATUV = SY-DATUM
EMENG = 1
MEHRS = 'X'
MTNRV = ORDER_ITEMS_IN-MATERIAL
RNDKZ = '2'
STLAL = '01'
WERKS = V_WERKS
IMPORTING
TOPMAT = CSTMAT
TABLES
STB = TSTB
MATCAT =
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
OTHERS = 8.
DESCRIBE TABLE TSTB LINES V_LINES.
ENDIF.
V_LINES1 = V_LINES + V_LINES1 .
CLEAR V_LINES.
ENDIF.
ENDLOOP.
or u can check below
u can populate both Line items and Schedule Line item structures - ORDER_ITEMS_IN and ORDER_SCHEDULES_IN respectively using BAPI_SALESORDER_CREATEFROMDAT2 to create sales order
hope this will help you.
Reward points if it helps
Regards,
Naveen
Similar Messages
-
Help me doing bapi related to catsdb only pls urgent step by step
Help me doing bapi related to catsdb only pls urgent step by step
thank you,
points will be rewarded,
Regards,
Jagrut BharatKumar ShuklaHelp me doing bapi related to catsdb only pls urgent step by step
thank you,
points will be rewarded,
Regards,
Jagrut BharatKumar Shukla -
Help needed in BAPI for uploading data in FB01 - Urgent!!!
Hi,
i need to post a document in FB01.
i am getting the following details from the user in a .CSV file.
Vendor no, vendor name, amount, document date, posting datem reference vendor line item text and Gl account line item text.
i am using BAPI BAPI_ACC_DOCUMENT_POST to post the document.
Now my req is if the amount is in negative then
use posting key 31 against the vendor and 40 for GL account
if its positive amounts
use posting key of 24 against vendor and 50 against the GL account.
Now by default, when the amount is negative the function is working fine.
but when its is positive its posting 21 against vendor and 50 against GL account. but i need 24 against vendor
can any one tel me, where should i pass these value in the BAPI?
or is there any other way of doing it?
Regards,
NiyazHi,
the posting keys 31/21 (01/11 and 40/50) are hard coded and cannot be populated from the interface. This is because a different posting key could have a different posting logic from what is implemented in the BAPI.
So unless you want to do some modifications here, you have to use the fixed PKs. Pls. let me know if you are interested in where exactly the PKs are defined (hardcoded). I have this noticed for myself earlier but my notices are on another PC
Hope that helps, points welcome
Csaba -
Plz help me out bapi message (urgent)
hi
i need help. i m passing values in bapi n taking message from table in bapi to print in out put.
requirment is..
a) Pass the following parameters:
NUMBER = NETWORK
Tables: I_COMPONENTS_CHANGE
COMPONENT = IT_COMP-COMPONENT
BATCH = P_CHARG
Tables: I_COMPONENTS_CHANGE_UPDATE
COMPONENT = IT_COMP-COMPONENT
BATCH = X
b) The components that failed update are provided in table, E_MESSAGE_TABLE. If MESSAGE_TYPE = E, get EXTERNAL_OBJECT_ID and MESSAGE_TEXT. Remove spaces from EXTERNAL_OBJECT_ID and then match against IT_COMP-COMPONENT to get MATERIAL, PLANT and NETWORK and write MATERIAL, PLANT and NETWORK and MESSAGE_TEXT to the job log.
so for that i m doing coding like (this is part of my program)
LOOP AT i_temp_comp.
CLEAR : i_comp_change,i_comp_upd,i_e_msg.
REFRESH : i_comp_change,i_comp_upd,i_e_msg.
LOOP AT i_comp WHERE network = i_temp_comp-network.
l_number = i_comp-network.
i_comp_change-component = i_comp-component.
i_comp_change-batch = p_charg.
APPEND i_comp_change.
i_comp_upd-component = i_comp-component.
i_comp_upd-batch = c_x.
APPEND i_comp_upd.
ENDLOOP.
CALL FUNCTION 'BAPI_NETWORK_COMP_CHANGE'
EXPORTING
number = l_number
TABLES
i_components_change = i_comp_change
i_components_change_update = i_comp_upd
e_message_table = i_e_msg.
IF NOT i_e_msg[] IS INITIAL.
LOOP AT i_e_msg.
IF i_e_msg-message_type = c_e.
READ TABLE i_comp WITH KEY network = l_number
component = i_e_msg-external_object_id. "#EC *
IF sy-subrc IS INITIAL.
i_output-material = i_comp-material.
i_output-plant = i_comp-plant.
i_output-network = i_comp-network.
i_output-message = i_e_msg-message_text.
APPEND i_output.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDLOOP.
problem is it is not showing message in i_output.
so no data is printing.
plz help me outThere are several IFs in your code here.
IF NOT i_e_msg[] IS INITIAL.
LOOP AT i_e_msg.
IF i_e_msg-message_type = c_e.
READ TABLE i_comp WITH KEY network = l_number
component = i_e_msg-external_object_id. "#EC *
IF sy-subrc IS INITIAL.
i_output-material = i_comp-material.
i_output-plant = i_comp-plant.
i_output-network = i_comp-network.
i_output-message = i_e_msg-message_text.
APPEND i_output.
ENDIF.
ENDIF.
ENDLOOP.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
It can be any IF failure. Check in debugging and see how this "i_e_msg" internal table is filled. May be the return table is giving the component number in external format and you have it in internal format or vice-versa in the READ statement "component = i_e_msg-external_object_id". -
hi,
I would be extremely gratefull if anyone could guid me how to upload & post excel data sheet in sap using bapi or bapi active X control.Also how data coversion are to be carried off ?
Scenario :
Excel sheet:
Name1 Name2 Age
joe dave 24
smith S 26
I want to upload this using bapi & then post the document in transaction zf12.Amna,
You can upload the file from the
Presentation Server - CL_GUI_FRONTEND_UTILITIES->GUI_UPLOAD
Application Server - OPEN DATASET.
However, you have not mentioned what data you are uploading as the BAPI will change depending on that. Look at the BAPI transaction and you will find a list of BAPI's classified according to the business functionality.
Once the data is internal table, you need to pass that to the BAPI function module.
Regards,
Ravi
Note : Please mark the helpful answers. -
Help- Problem witth BAPI Confirmation
Hi gurus,
Please , i need some help with some problems i am having with BAPIs for confirmations.
I have found this one : BAPI_PRODORDCONF_GET_TT_PROP, to get the propose data, but i i can't figured out how to fill the goodmovements table. I need to do this, because i want to know the proposal of goodmovements, just exactly that sap's does when i enter to the tx CO11N, enter the YIELD quantity and then press "goods movements" button.
Please, is there some trick or something to make this work? ( i have already put "X" in the import "PROPOSE - GOODMOVEMENTS" , but still is not working).
If get this, i could put this values in BAPI_PRODORDCONF_CREATE_TT and that's it... i suppose.
Please help me
Thanks a lot!Hi ,
Before going into BAPI's , Auto goods movement happens in two ways.
1. check whether Auto goods receipt is checked in T.code OPKP.
2. The other way is to assign a Control Key to the operation which has a Auto GR checked.
Please check these two and then trigger confirmation using your BAPI.
Hope this helps.
Best Regards. -
Help - Problem with BAPI confirmation (co11n)
Hi gurus,
Please , i need some help with some problems i am having with BAPIs for confirmations.
I have found this one : BAPI_PRODORDCONF_GET_TT_PROP, to get the propose data, but i i can't figured out how to fill the goodmovements table. I need to do this, because i want to know the proposal of goodmovements, just exactly that sap's does when i enter to the tx CO11N, enter the YIELD quantity and then press "goods movements" button.
Please, is there some trick or something to make this work? ( i have already put "X" in the import "PROPOSE - GOODMOVEMENTS" , but still is not working).
If get this, i could put this values in BAPI_PRODORDCONF_CREATE_TT and that's it... i suppose.
Please help me
Thanks a lot!Hi ,
Before going into BAPI's , Auto goods movement happens in two ways.
1. check whether Auto goods receipt is checked in T.code OPKP.
2. The other way is to assign a Control Key to the operation which has a Auto GR checked.
Please check these two and then trigger confirmation using your BAPI.
Hope this helps.
Best Regards. -
Hi experts,
I am trying to implement BAPI for simulating tcode. FBS1.
As a first step, I have implemented the BAPI -> BAPI_ACC_GL_POSTING_POST
I did not find any holder where i can give the reversal date. But I could find reason_rev for reversal reason.
Now as a second step. I am trying to use the BAPI -> BAPI_ACC_GL_POSTING_REV_POST.
I am trying to pass the following values from the first BAPI
reversal-obj_type = obj_type.
reversal-obj_key = obj_key.
reversal-obj_sys = obj_sys.
reversal-obj_key_r = 'AWREF_REV'.
I am not sure if i have to pass the reversal date in reversal-pstng_date
Can some one please let me know if I am missing something here.
Also please let me know if I am going in the correct way to implement BAPI for FBS1
thanks alot.hi
you can try out bapi's like
BAPI_ACC_GL_POSTING_POST and BAPI_ACC_GL_POSTING_REV_POST.
you can use FM as well which is POSTING_INTERFACE_DOCUMENT
you can check out this link for all the bapi's -http://planetsap.com/Bapi_main_page.htm
hope this helps
regards
Aakash Banga -
Hi Experts!
I am trying to use 'BAPI_OUTB_DELIVERY_CONFIRM_DEC' for posting goods issue but could not succeed. I am getting the message 615 (Delivery item is not or only partially packed) when I test the same in SE37. However the same delivery, if I go to VL02n and issue post goods issue, it is succeeding. I think I am doing some mistake with the parameters to be passed to bapi. Please help me find the error as I am unable to find. I am stuck with this for pretty long time. Points assured for helpful answers.
Thanks for your time.
Krishen
DATA: itab_headerdata TYPE STANDARD TABLE OF bapiobdlvhdrcon WITH HEADER LINE.
DATA: itab_headercontrol TYPE STANDARD TABLE OF bapiobdlvhdrctrlcon WITH HEADER LINE.
DATA: itab_itemdata TYPE STANDARD TABLE OF bapiobdlvitemcon WITH HEADER LINE.
DATA: itab_itemcontrol TYPE STANDARD TABLE OF bapiobdlvitemctrlcon WITH HEADER LINE .
DATA: itab_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: itab1_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: itab3_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: deliv_numb TYPE bapiobdlvhdrcon-deliv_numb.
Vbeln and posnr are coming from itab.
SELECT SINGLE * FROM likp
WHERE vbeln = itab-vbeln.
SELECT SINGLE * FROM lips
WHERE vbeln = itab-posnr.
itab_headerdata-deliv_numb = likp-vbeln.
itab_headercontrol-deliv_numb = likp-vbeln.
itab_headercontrol-post_gi_flg = 'X'.
CLEAR deliv_numb.
deliv_numb = likp-vbeln.
itab_itemdata-deliv_numb = likp-vbeln.
itab_itemdata-deliv_item = lips-posnr.
itab_itemdata-dlv_qty = lips-lfimg.
itab_itemdata-sales_unit = lips-meins.
itab_itemdata-fact_unit_nom = lips-umvkz.
itab_itemdata-fact_unit_denom = lips-umvkn.
itab_itemcontrol-deliv_numb = likp-vbeln.
itab_itemcontrol-deliv_item = lips-posnr.
itab_itemcontrol-chg_delqty = 'X'.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
EXPORTING
header_data = itab_headerdata
header_control = itab_headercontrol
delivery = deliv_numb
TECHN_CONTROL =
TABLES
HEADER_PARTNER =
HEADER_PARTNER_ADDR =
HEADER_DEADLINES =
item_data = itab_itemdata
item_control = itab_itemcontrol
ITEM_SERIAL_NO =
SUPPLIER_CONS_DATA =
HANDLING_UNIT_HEADER =
HANDLING_UNIT_ITEM =
HANDLING_UNIT_SERNO =
EXTENSION1 =
EXTENSION2 =
return = itab_bapiret2.
TOKENREFERENCE =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = itab1_bapiret2.Hi Krishen
Have done some modifications to your code. Highlighted below are the same. Please check if the same works for you.
DATA: itab_headerdata TYPE STANDARD TABLE OF bapiobdlvhdrcon WITH HEADER LINE.
DATA: itab_headercontrol TYPE STANDARD TABLE OF bapiobdlvhdrctrlcon WITH HEADER LINE.
DATA: itab_itemdata TYPE STANDARD TABLE OF bapiobdlvitemcon WITH HEADER LINE.
DATA: itab_itemcontrol TYPE STANDARD TABLE OF bapiobdlvitemctrlcon WITH HEADER LINE .
DATA: itab_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: itab1_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: itab3_bapiret2 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: deliv_numb TYPE bapiobdlvhdrcon-deliv_numb.
Vbeln and posnr are coming from itab.
SELECT SINGLE * FROM likp
WHERE vbeln = itab-vbeln.
SELECT SINGLE * FROM lips
WHERE vbeln = itab-posnr.
<b>select single kostk from vbuk into vbuk-kostk
where vbeln = itab-vbeln
and kostk = 'C'.
if sy-subrc ne 0.
message "Picking is not fully done
else.</b>
itab_headerdata-deliv_numb = likp-vbeln.
itab_headercontrol-deliv_numb = likp-vbeln.
itab_headercontrol-post_gi_flg = 'X'.
CLEAR deliv_numb.
deliv_numb = likp-vbeln.
<b>*itab_itemdata-deliv_numb = likp-vbeln.
*itab_itemdata-deliv_item = lips-posnr.
*itab_itemdata-dlv_qty = lips-lfimg.
*itab_itemdata-sales_unit = lips-meins.
*itab_itemdata-fact_unit_nom = lips-umvkz.
*itab_itemdata-fact_unit_denom = lips-umvkn.
*itab_itemcontrol-deliv_numb = likp-vbeln.
*itab_itemcontrol-deliv_item = lips-posnr.
*itab_itemcontrol-chg_delqty = 'X'.</b>
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
EXPORTING
header_data = itab_headerdata
header_control = itab_headercontrol
delivery = deliv_numb
TECHN_CONTROL =
TABLES
HEADER_PARTNER =
HEADER_PARTNER_ADDR =
HEADER_DEADLINES =
item_data = itab_itemdata
item_control = itab_itemcontrol
ITEM_SERIAL_NO =
SUPPLIER_CONS_DATA =
HANDLING_UNIT_HEADER =
HANDLING_UNIT_ITEM =
HANDLING_UNIT_SERNO =
EXTENSION1 =
EXTENSION2 =
return = itab_bapiret2.
TOKENREFERENCE =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = itab1_bapiret2.
<b>endif.</b>
Kind Regards
Eswar -
Pls help I have Bapi error response scenario
Hi Experts,
I am working ona scenario.
Sender will drop the required file on XI directory and XI will pull the file and map it with the BAPI u2013 and crate time entries in SAP HR. If errors are encountered during the process they are returned to the client in a report or as erroneous file.
1) sender will FTP the file to XI directory
2) XI will send the file after validation with BAPI for time entry creation in SAP R/3.
3) If there is an error encountered XI will get an error response from BAPI
*4) The erroneous file is sent to XI directory for client to view*
I have to write this error files on the Xi directory.
*How will I capure the error response from BAPI. as we are interested only for failure messages and not the sucessful messages. How we filter the mesages in XI, we want to capyure only failed messages.*
Please help me out wz this.
ThanksHello,
Your situation it is quite common task so refer to this step-by-step wiki:
File-RFC-File(Without BPM)
http://wiki.sdn.sap.com/wiki/display/XI/File-RFC-File(Without+BPM)
What concerns that you want receive only response with error this is also not problem. In all BAPI function you can find response code which differ for successful and unsuccessful processing. So only you need to do it is filter data in you scenario with ERROR response code, you can do this in condition section of receiver determination.
And if you want you can adjust two response streams in XI, one for successfull processing and another one for error (also with filtering).
BR,
Dzmitry -
Please help with this bapi for creating billing document
I want to create a billing document using the bapi: BAPI_BILLINGDOC_CREATEMULTIPLE from a delivery number and NOT A SALES ORDER.
Please tell me what details to be passed to table BILLINGDATAIN . Please don't provide me function module documentation because it does n't help me create billing document from delivery. A sample source code or suggestion to what to pass would be really great!
Thanks,
Krishen
P.S. Points assured for helpful answers and thanks for your time.Hi,
Try this..
DATA: s_vbap TYPE vbap.
TABLES: vbak,vbap,likp, lips.
DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.
DATA: t_conditions TYPE STANDARD TABLE OF bapikomv WITH HEADER LINE.
DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.
DATA: t_ccard TYPE STANDARD TABLE OF bapiccard_vf WITH HEADER LINE.
DATA: t_errors TYPE STANDARD TABLE OF bapivbrkerrors WITH HEADER LINE.
DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE
PARAMETERS: p_vbeln TYPE vbeln.
select single * from likp
where vbeln = p_vbeln.
SELECT SINGLE * from lips where
vbeln = likp-vbeln.
t_billing-salesorg = likp-vkorg.
t_billing-ref_doc = likp-vbeln.
t_billing-ref_item = lips-posnr.
t_billing-doc_number = p_vbeln.
t_billing-itm_number = lips-posnr.
t_billing-ordbilltyp = 'ZINV'.
t_billing-price_date = sy-datum.
t_billing-ref_doc_ca = likp-vbtyp.
t_billing-material = lips-matnr.
t_billing-plant = lips-werks.
APPEND t_billing.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = t_billing
return = t_return
success = t_success
commit work.
Thanks,
Naren -
Help Rgd. BAPI for Creation of Inbound delivery Document
Hi all,
I need a Bapi to create inbound delivery document without using PO reference. I have seen the below BAPIs. i) BAPI_IBDLV_CREATE_FROM_OBDLV,
ii) BAPI_GOODSMVT_CREATE. I am not sure whether they are for creating inbound delivery document without using PO reference.
It will be of great use if anyone can give me the BAPI for the purpose and the mandatory parameters or sample test data for the BAPI.
Thanks in Advance,
Rakesh.If you create the inbound delivery->check the purchase order in the tabstrip "Confirmations" on item level. There are three fields: "Confirmation control key", "Order acknowl." and "acknowl. required".
Ckeck if there is a value in "confirmation control key".
You should get the same error if you try to create VL31N in dialog mode, not only by using the bapi.
Rgds,
JP -
Help needed in bapi _requistion _create
Hi all,
I want to assign a delivery address and unloading point to a purchase requistion i got the delvery address but iam not able to figure out the unloading point.
I want you guys to let me know from which table i have to retrieve the unloading point and assign to which part of BAPI.
Iam sending my code please take a look at it and let me know if iam wrong any where and what i need to add for unloading point.
data: begin of itab_bapiebkn occurs 100.
include structure bapiebkn.
data: end of itab_bapiebkn.
data : I_BAPIMERQADDRDELIVERY TYPE TABLE OF BAPIMERQADDRDELIVERY,
W_BAPIMERQADDRDELIVERY TYPE BAPIMERQADDRDELIVERY.
w_quantity = itab-multiple * itab-bstrf.
w_item_no = w_item_no + 1.
itab_bapiebanc-preq_item = w_item_no.
itab_bapiebanc-doc_type = c_doc_type.
itab_bapiebanc-created_by = sy-uname.
itab_bapiebanc-material = itab-matnr.
itab_bapiebanc-plant = itab-werks.
itab_bapiebanc-quantity = w_quantity.
itab_bapiebanc-deliv_date = sy-datum + 1.
itab_bapiebanc-trackingno = w_bednr.
append itab_bapiebanc.
w_bapimerqaddrdelivery-PREQ_ITEM = w_item_no.
IF S_GROUP = '2'.
SELECT SINGLE * FROM TVARV WHERE NAME EQ 'ZGRP1'.
IF SY-SUBRC EQ 0.
SELECT SINGLE ADDRNUMBER FROM ADRC INTO w_bapimerqaddrdelivery-ADDR_NO
WHERE ADDRNUMBER = TVARV-LOW.
ENDIF.
Thanks in advance
SuchitraHi,
Check the sample code.
REPORT ZTEST_BAPI_PR .
DATA:WA_EBAN LIKE EBAN.
DATA: BEGIN OF ITAB OCCURS 0,
BSART(4),
* ."Purchase requisition document type
WERKS(4),
* Plant
TXZ01(40),
* ."Short text
MENGE(13),
* ."Purchase requisition quantity
MEINS(3),
* ."Purchase requisition unit of measure
EEIND(10),
* ."Item delivery date
WGBEZ(9),
* ."Material Group
NAME1(4),
* ."Plant
EKGRP(3),
* ."Purchasing Group
AFNAM(12),
* ."Name of requisitioner/requester
BEDNR(10),
* ."Requirement Tracking Number
KNTTP(1),
* ."Account assignment category
SAKTO(10),
* ."G/L Account Number
PS_POSID(8),
* ."Work Breakdown Structure Element (WBS Element)
EDITOR(132),
* ."Text line
END OF ITAB.
DATA: ITAB_BAPIEBANC LIKE BAPIEBANC OCCURS 0 WITH HEADER LINE.
DATA: ITAB_BAPIEBKN LIKE BAPIEBKN OCCURS 0 WITH HEADER LINE.
DATA: ITAB_BAPIEBANTX LIKE BAPIEBANTX OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF ERRMSG OCCURS 10.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF ERRMSG.
DATA: ERRFLAG.
SELECT SINGLE * FROM EBAN
INTO WA_EBAN.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING WA_EBAN TO ITAB.
APPEND ITAB.
CLEAR ITAB.
ENDIF.
*CALL FUNCTION 'UPLOAD'
* EXPORTING
* filename = 'C:Documents and SettingssapDesktopNew Text Document (2).txt'
* filetype = 'DAT'
* TABLES
* data_tab = itab.
*if sy-subrc <> 0.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
* exit.
*endif.
LOOP AT ITAB.
ITAB_BAPIEBANC-DOC_TYPE = ITAB-BSART.
ITAB_BAPIEBANC-SHORT_TEXT = ITAB-TXZ01.
ITAB_BAPIEBANC-QUANTITY = ITAB-MENGE.
ITAB_BAPIEBANC-UNIT = ITAB-MEINS.
IF NOT ITAB-EEIND IS INITIAL.
ITAB_BAPIEBANC-DELIV_DATE = ITAB-EEIND.
ELSE.
ITAB_BAPIEBANC-DELIV_DATE = SY-DATUM + 30.
ENDIF.
ITAB_BAPIEBANC-PLANT = ITAB-WERKS.
ITAB_BAPIEBANC-PUR_GROUP = ITAB-EKGRP.
ITAB_BAPIEBANC-PREQ_NAME = ITAB-AFNAM.
ITAB_BAPIEBANC-TRACKINGNO = ITAB-BEDNR.
ITAB_BAPIEBANC-MAT_GRP = ITAB-WGBEZ.
ITAB_BAPIEBANC-ACCTASSCAT = ITAB-KNTTP.
ITAB_BAPIEBANC-ACCTASSCAT = 'A'.
ITAB_BAPIEBKN-G_L_ACCT = ITAB-SAKTO.
ITAB_BAPIEBKN-WBS_ELEM = ITAB-PS_POSID.
* itab_bapiebantx-text_line = itab-editor.
ITAB_BAPIEBANTX-TEXT_LINE = 'Test for Purchase requisiton'.
APPEND ITAB_BAPIEBKN.
APPEND ITAB_BAPIEBANC.
APPEND ITAB_BAPIEBANTX.
ENDLOOP.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
TABLES
REQUISITION_ITEMS = ITAB_BAPIEBANC
REQUISITION_ACCOUNT_ASSIGNMENT = ITAB_BAPIEBKN
REQUISITION_ITEM_TEXT = ITAB_BAPIEBANTX
RETURN = ERRMSG.
LOOP AT ERRMSG.
IF ERRMSG-TYPE EQ 'E'.
WRITE:/'Error in function', ERRMSG-MESSAGE.
ERRFLAG = 'X'.
ELSEif ERRMSG-TYPE = 'S' .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
WRITE:/ ERRMSG-MESSAGE.
ENDIF.
ENDLOOP.
Regards
vijay -
Modifying the Breakdown Duration with the help of a BAPI
Hi,
I am using BAPI_ALM_NOTIF_DATA_MODIFY to modify a notification. This BAPI allows to modify everything but the Breakdown duration.Any idea why is that? Or is there a workaround?
From a SAP Note it seems for MCI7 - Brekdown Analysis report would show correct results for MTTR & MTBR only if the breakdown duration is properly populated.(thats one of the conditions that should be met.)
ThanksHai, Breakdown duration is automatically calculated by SAP based on the malfunction start date & time, Malfunction end date & time entered in the notification.
regards
SRN -
New to ABAP -- Need help with any BAPI to update the vendor master record
I have a requirement to update the vendor master record ( ie purchasing block data inlfa1 and lfm1 table )directly. i have created the report but my problem is i am updating tables directly by using modify which is not correct according to SAP hence i want to use bapi whereby i can change the fields of the table. does anyone know any bapi which can modify the lfa1-sprem field and lfm1-sperm field. Plz hep me. They have specifically asked me to do it using BAPI's.
MAP2e_lfa1_to_bapivendor_04
MAP2e_lfa1_to_bapivendor_05
will be helpful
Maybe you are looking for
-
Calendar question on the 9530...
Hello everyone. So this thread might be better in the newbie section, but since the storm is so different than the other BB's I figured here is a good place to start. I've had my storm since April 2009 and am just starting to use the calendar. I use
-
Any session scope form handler out of the box in atg commerce
Is there any session scope form handler out of the box in atg commerce. Let me know if anyone is aware of such form handler. Thanks, Santosh
-
I am making a GUI for a little software game. But i have a problem with my slider. I want to change the selection color from the tumb from the standard "beautiful" purple to another color. I've tried following settings , with UIManager.put("Slider.ba
-
Use Broadcasting bursting functionality for 1:n assignment
Dear all, I want to use the bursting functionality of the Bex Broadcaster in order to send a Sales report to each Region Sales Manager for his sales region. Due to the fact that in my case a sales region can have several Regional Manager, it it not p
-
Software update for Original Tablet S
With all of the great minds (and resourses) over at Sony, why has no one come up with a software upgrade/update for us original TABLET S owners??? How long must we wait. I'm truly feeling left out and ripperd off, I'm afraid... With no updates in the