Problem in BAPI for FB70
Hi all,
I have used the BAPI_ACC_DOCUMENT_POST to create the customer invoice.But, when i run the program it is giving the error as
Error in document: BKPF $ DEVCLNT250
Incorrect entry in field OBJ_TYPE: BKPF
i am passing the entry as OBJ_TYPE = 'BKPF'.
Can anyone let me know wat shoud i pass to this parameter.
regards
Mustafa
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
2 0AA98 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
3 0AA99 1000 1234556 3.8.09 3.8.09 Bapi Test 1000 SAR 790100 1000 200 SAR
i m using the above test template to create the customer invoice but it is giving the error as '-'cannot interpret as a number.i am concatenating the amount in doc. currency with '-'.but if i remove that variable and assign the values directly from excel file it is giving the error as GL Account is not assigned for line item 2.
i m able to uplaod the data for one customer and the document is getting created.but for multiple header data and their line items it is giving the error.
Similar Messages
-
Hi !!!
Someone knows what's the bapi that i can use as alternative by the transaction FB70 ( Customer Invoice ).
Best Regards !!!sample code is:
REPORT zfb70.
*-----Type pool declaration
TYPE-POOLS: truxs.
*-----Structure declaration
TYPES : BEGIN OF ty_tab,
col1(30) TYPE c, "Serial No
col2(30) TYPE c, "Customer No
col3(30) TYPE c, "Company Code
col4(30) TYPE c, "Reference Document No
col5(30) TYPE c, "Document date
col6(30) TYPE c, "Posting Date
col7(30) TYPE c, "Text
col8(30) TYPE c, "Amount
col9(30) TYPE c, "Currency
col10(30) TYPE c, "G/L Account
col11(30) TYPE c, "Company Code
col12(50) TYPE c, "Amount in Doc.Currency
col13(50) TYPE c, "Currency
col14(50) TYPE c, "Profit center
col15(50) TYPE c, "Item text
END OF ty_tab,
BEGIN OF ty_header,
col1(30) TYPE c, "Serial No
col2(30) TYPE c, "Customer No
col3(30) TYPE c, "Company Code
col4(30) TYPE c, "Reference Document No
col5(30) TYPE c, "Document date
col6(30) TYPE c, "Posting Date
col7(30) TYPE c, "Text
col8(30) TYPE c, "Amount
col9(30) TYPE c, "Currency
END OF ty_header,
BEGIN OF ty_lineitem,
col10(30) TYPE c, "G/L Account
col11(30) TYPE c, "Company Code
col12(50) TYPE c, "Amount in Doc.Currency
col13(50) TYPE c, "Currency
col14(50) TYPE c, "Profit center
col15(50) TYPE c, "Item text
END OF ty_lineitem.
*-----Internal table declarations
DATA : it_tab TYPE STANDARD TABLE OF ty_tab,
it_raw TYPE truxs_t_text_data,
it_header TYPE STANDARD TABLE OF ty_header,
it_lineitem TYPE STANDARD TABLE OF ty_lineitem,
it_bapiaccr09 TYPE STANDARD TABLE OF bapiaccr09,
it_bapiacgl09 TYPE STANDARD TABLE OF bapiacgl09,
it_bapiacar09 TYPE STANDARD TABLE OF bapiacar09,
it_bapiaccr09_temp TYPE STANDARD TABLE OF bapiaccr09,"#EC NEEDED
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,"#EC *
return1 LIKE bapiret2 OCCURS 0 WITH HEADER LINE,"#EC *
*-----Workarea declarations
x_tab LIKE LINE OF it_tab,
x_header LIKE LINE OF it_header,
x_lineitem LIKE LINE OF it_lineitem,
x_invheader TYPE bapiache09 OCCURS 0 WITH HEADER LINE,"#EC *
x_bapiaccr09 LIKE LINE OF it_bapiaccr09,
x_bapiacgl09 LIKE LINE OF it_bapiacgl09,
x_bapiacar09 LIKE LINE OF it_bapiacar09,
x_bapiaccr09_temp LIKE LINE OF it_bapiaccr09,
*-----Variables declarations
v_str1(2) TYPE c,
v_str2(2) TYPE c,
v_str3(4) TYPE c,
v_doc_date LIKE sy-datum,
v_pstng_date LIKE sy-datum,
v_obj_key TYPE bapiache09-obj_key,
v_text TYPE string,
v_customer TYPE bapiacar09-customer,
v_gl_account TYPE bapiacgl09-gl_account,
v_itemno TYPE bapiacgl09-itemno_acc,
v_itemno_1 TYPE bapiacgl09-itemno_acc,
v_amount(25) TYPE c.
SELECTION-SCREEN declaration *
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) text-001 FOR FIELD p_fname.
SELECTION-SCREEN POSITION 25.
PARAMETERS: p_fname(128) TYPE c OBLIGATORY.
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*-----Calling function for selecting the local file
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_fname.
START-OF-SELECTION *
START-OF-SELECTION.
*-----Uploading excel file into internal table
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_fname
TABLES
i_tab_converted_data = it_tab[]
EXCEPTIONS
conversion_failed = 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.
LOOP AT it_tab INTO x_tab.
*-----Checking for existing data in it_header
READ TABLE it_header INTO x_header WITH KEY col1 = x_tab-col1
col2 = x_tab-col2
col3 = x_tab-col3
col4 = x_tab-col4
col5 = x_tab-col5
col6 = x_tab-col6
col7 = x_tab-col7
col8 = x_tab-col8
col9 = x_tab-col9.
IF sy-subrc NE 0.
IF x_header IS NOT INITIAL.
*-----calling bapi for creating customer invoice
PERFORM call_bapi.
REFRESH : it_header, it_lineitem.
ENDIF.
*-----making header table
x_header-col1 = x_tab-col1.
x_header-col2 = x_tab-col2.
x_header-col3 = x_tab-col3.
x_header-col4 = x_tab-col4.
x_header-col5 = x_tab-col5.
x_header-col6 = x_tab-col6.
x_header-col7 = x_tab-col7.
x_header-col8 = x_tab-col8.
x_header-col9 = x_tab-col9.
x_lineitem-col10 = x_tab-col10.
x_lineitem-col11 = x_tab-col11.
x_lineitem-col12 = x_tab-col12.
x_lineitem-col13 = x_tab-col13.
x_lineitem-col14 = x_tab-col14.
x_lineitem-col15 = x_tab-col15.
APPEND x_header TO it_header.
APPEND x_lineitem TO it_lineitem.
ELSE.
x_lineitem-col10 = x_tab-col10.
x_lineitem-col11 = x_tab-col11.
x_lineitem-col12 = x_tab-col12.
x_lineitem-col13 = x_tab-col13.
x_lineitem-col14 = x_tab-col14.
x_lineitem-col15 = x_tab-col15.
APPEND x_lineitem TO it_lineitem.
ENDIF.
ENDLOOP.
*-----Calling BAPI for last set of data
PERFORM call_bapi.
REFRESH : it_header, it_lineitem.
Form call_bapi *
FORM call_bapi.
*-----Formatting invoice date
SPLIT x_header-col5 AT '.' INTO v_str1 v_str2 v_str3.
IF STRLEN( v_str1 ) LT 2.
CONCATENATE '0' v_str1 INTO v_str1.
ENDIF.
IF STRLEN( v_str2 ) LT 2.
CONCATENATE '0' v_str2 INTO v_str2.
ENDIF.
IF STRLEN( v_str3 ) LT 4.
CONCATENATE '20' v_str3 INTO v_str3.
ENDIF.
CONCATENATE v_str3 v_str1 v_str2 INTO v_doc_date.
CLEAR : v_str1, v_str2, v_str3.
*-----Formatting posting date
SPLIT x_header-col6 AT '.' INTO v_str1 v_str2 v_str3.
IF STRLEN( v_str1 ) LT 2.
CONCATENATE '0' v_str1 INTO v_str1.
ENDIF.
IF STRLEN( v_str2 ) LT 2.
CONCATENATE '0' v_str2 INTO v_str2.
ENDIF.
IF STRLEN( v_str3 ) LT 4.
CONCATENATE '20' v_str3 INTO v_str3.
ENDIF.
CONCATENATE v_str3 v_str1 v_str2 INTO v_pstng_date.
CLEAR : v_str1, v_str2, v_str3.
*-----Making the Header
x_invheader-obj_type = 'BKPFF'. "Reference procedure
x_invheader-obj_key = '$'. "Object key
CONCATENATE sy-sysid 'CLNT' sy-mandt INTO
x_invheader-obj_sys. "Logical system of source document
x_invheader-bus_act = 'RFBU'. "Business Transaction
x_invheader-username = sy-uname. "User name
x_invheader-header_txt = x_header-col7. "Document Header Text
x_invheader-comp_code = x_header-col3. "Company Code
x_invheader-doc_date = v_doc_date. "Document Date in Document
x_invheader-pstng_date = v_pstng_date. "Posting Date in the Document
x_invheader-doc_type = 'DR'. "Reference Document Number
x_invheader-ref_doc_no = x_header-col4. "Reference Document Number
*-----For ACCOUNTRECEIVABLE
LOOP AT it_header INTO x_header.
x_bapiacar09-itemno_acc = '1'. "Accounting Document Line Item Number
*-----Filling zeros before Customer No
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_header-col2
IMPORTING
output = v_customer.
x_bapiacar09-customer = v_customer. "Customer Number 1
x_bapiacar09-comp_code = x_header-col3. "Company Code
APPEND x_bapiacar09 TO it_bapiacar09.
ENDLOOP.
*-----For ACCOUNTGL
LOOP AT it_lineitem INTO x_lineitem.
IF it_bapiacgl09 IS INITIAL.
v_itemno = 2.
ELSE.
v_itemno = v_itemno + 1.
ENDIF.
x_bapiacgl09-itemno_acc = v_itemno. "Accounting Document Line Item Number
*-----Filling zeros before G/L Account no
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_lineitem-col10
IMPORTING
output = v_gl_account.
x_bapiacgl09-gl_account = v_gl_account. "General Ledger Account
x_bapiacgl09-comp_code = x_lineitem-col11. "Company Code
x_bapiacgl09-profit_ctr = x_lineitem-col14. "Profit Center
x_bapiacgl09-item_text = x_lineitem-col15. "Item Text
APPEND x_bapiacgl09 TO it_bapiacgl09.
ENDLOOP.
*-----Clearing variable
CLEAR : v_itemno.
*-----For CURRENCYAMOUNT
LOOP AT it_header INTO x_header.
x_bapiaccr09-itemno_acc = '0000000001'. "Accounting Document Line Item Number
x_bapiaccr09-curr_type = '00'. "Currency type and valuation view
x_bapiaccr09-amt_doccur = x_header-col8. "Amount in document currency
x_bapiaccr09-currency = x_header-col9. "Currency Key
APPEND x_bapiaccr09 TO it_bapiaccr09.
ENDLOOP.
v_itemno_1 = 1.
LOOP AT it_lineitem INTO x_lineitem.
v_itemno_1 = v_itemno_1 + 1.
x_bapiaccr09_temp-itemno_acc = v_itemno_1. "Accounting Document Line Item Number
x_bapiaccr09_temp-curr_type = '00'. "Currency type and valuation view
CONCATENATE '-' x_lineitem-col12 INTO v_amount.
x_bapiaccr09_temp-amt_doccur = v_amount. "x_lineitem-col12. "Amount in document currency
x_bapiaccr09_temp-currency = x_lineitem-col13. "Currency Key
APPEND x_bapiaccr09_temp TO it_bapiaccr09.
ENDLOOP.
CLEAR : v_itemno_1.
*-----Calling BAPI for creating Customer Invoice
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = x_invheader
IMPORTING
obj_key = v_obj_key
TABLES
accountgl = it_bapiacgl09
accountreceivable = it_bapiacar09
currencyamount = it_bapiaccr09
return = return.
*-----Check the return code for error message.
LOOP AT return
TRANSPORTING NO FIELDS
WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
*-----Generating errors (if any)
IF sy-subrc = 0.
WRITE : text-003, x_header-col1. "Serial No :
WRITE :/ text-002. "Invoice Not Created Because :
LOOP AT return. "#EC *
WRITE:/ "return-type,
return-message.
ENDLOOP.
ULINE :/(150).
ELSE.
*-----BAPI Commit
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = return1.
*-----Displaying invoice no as Success message
WRITE : text-003, x_header-col1. "Serial No :
CONCATENATE 'Invoice No. ' v_obj_key+0(10) ' Created ' INTO v_text."#EC NOTEXT
WRITE :/ v_text.
ULINE :/(150).
ENDIF.
*-----Refreshing internal tables
REFRESH : it_bapiaccr09, it_bapiacgl09, it_bapiacar09, it_bapiaccr09_temp, return.
ENDFORM. " call_bapi -
Hi Experts,
I have Written this below code to upload Delivery with refrence to sales orders with batch split . when i execute this program it is retuning the message that the transfered sales order table is empty.
If i change the document_catogy_sd = ' L '.
then its not retuning any message but its not creating any deliveries. please find and fix the problem in this program.
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE1
IF NOT L_FILE1 IS INITIAL.
P_FILE1 = L_FILE1.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE2.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = L_FILE2
IF NOT L_FILE2 IS INITIAL.
P_FILE2 = L_FILE2.
ENDIF.
START-OF-SELECTION.
PERFORM F_UPLOAD TABLES ITAB USING P_FILE1.
PERFORM F_UPLOAD1 TABLES ITAB1 USING P_FILE2.
SORT ITAB1 BY VBELN.
ITAB1[] = ITAB[] .
LOOP AT ITAB.
ITABL-DOCUMENT_CATEGORY_SD = 'J'.
ITABL-DOCUMENT_NUMB = ITAB-VBELN.
ITABL-DOCUMENT_ITEM = ITAB-ITEMNO.
ITABL-RECEIVING_POINT = ITAB-VSTEL.
ITABL-DATE = ITAB-VSTEL.
ITABL-DELIVERY_DATE = ITAB-WADAT.
ITABL-GOODS_ISSUE_DATE = ITAB-WADAT_IST.
ITABL-LOADING_DATE = ITAB-LDDAT.
ITABL-MAT_AVAILABIL_DATE = ITAB-MBDAT.
ITABL-MATERIAL = ITAB-MATNR.
ITABL-QUANTITY_SALES_UOM = ITAB-SOQTY.
IT_FINAL-DOCUMENT_NUMB = ITAB-VBELN.
IT_FINAL-DOCUMENT_ITEM = ITAB-ITEMNO.
IT_FINAL-RECEIVING_POINT = ITAB-VSTEL.
IT_FINAL-DATE = ITAB-VSTEL.
IT_FINAL-DELIVERY_DATE = ITAB-WADAT.
IT_FINAL-GOODS_ISSUE_DATE = ITAB-WADAT_IST.
IT_FINAL-LOADING_DATE = ITAB-LDDAT.
IT_FINAL-MAT_AVAILABIL_DATE = ITAB-MBDAT.
IT_FINAL-MATERIAL = ITAB-MATNR.
IT_FINAL-QUANTITY_SALES_UOM = ITAB-SOQTY.
it_doc-DOCUMENT_CATEGORY_SD = 'J'.
append it_doc.
APPEND IT_FINAL.
LOOP AT ITAB1 WHERE VBELN = ITAB-VBELN AND ITEMNO = ITAB-ITEMNO.
ITABL-STGE_LOC = ITAB1-LGORT.
ITABL-BATCH = ITAB1-CHARG.
itabl-QUANTITY_BASE__UOM = itab1-lfimg.
itab1-MAT_AVAILABIL_DATE = itab1-mbdat.
IT_FINAL-STGE_LOC = ITAB1-LGORT.
IT_FINAL-BATCH = ITAB1-CHARG.
*it_final-lfimg = itab1-lfimg.
APPEND IT_FINAL.
ENDLOOP.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
EXPORTING
DELIVERY_EXTEND =
TECHN_CONTROL =
TABLES
REQUEST = IT_FINAL
PARTNER =
PARTNER_ADDR =
TEXT_HEADER =
TEXT_LINES =
CREATEDITEMS = it_doc
RETURN = IT_RETUN .
EXTENSION1 =
EXTENSION2 =
CO_CHAR_VALUES =
BATCH_ATTRIBUTES =
BATCH_VALUES_CHAR =
BATCH_VALUES_CURR =
BATCH_VALUES_NUM =
TOKENREFERENCE =
WRITE: / ' ** S.T.O. HELD WITH DOCUMENT NO ** ', TEXT1.
WRITE: / SPACE.
*loop at iret.
*endloop.
LOOP AT IT_RETUN.
WHERE TYPE = 'A'
OR TYPE = 'E'.
WRITE:/ IT_RETUN-TYPE, ' ', IT_RETUN-MESSAGE.
EXIT.
ENDLOOP.
ENDLOOP.
IF SY-SUBRC = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
commit work and WAIT.
ENDIF.
*& Form f_upload
text
-->P_ITAB text
-->P_P_FILE1 text
FORM F_UPLOAD TABLES P_ITAB STRUCTURE ITAB
USING P_P_FILE1.
DATA: V_FILE TYPE STRING.
V_FILE = P_P_FILE1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ITAB.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " f_upload
*& Form f_upload1
text
-->P_ITAB1 text
-->P_P_FILE2 text
FORM F_UPLOAD1 TABLES P_ITAB1 STRUCTURE ITAB1
USING P_P_FILE2.
DATA: V_FILE1 TYPE STRING.
V_FILE1 = P_P_FILE2.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILE1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ITAB1.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " f_upload1
Thanks in Advance...
Points Rewarded.
Regards.
Ravi...
Message was edited by:
Ravi reddyHi Naveen,
Thanks for the reply. Even after using FM QAVE_PROCESS_AUTO_UD,when i execute
BAPI_GOODSMVT_CREATE, the same thing is happening.I am unable to see the stock deducted in QA33.
Is there any input in the goods mvt bapi where we can provide inspection lot no since i believe that the goods mvt has to get connected with the inspection lot. -
Problem in BAPI for stock posting from quality inspection to unrestricted usage
Hi all,
I am using BAPI_GOODSMVT_CREATE for stock posting from quality inspection to unrestricted usage Stock against quality inspection lot(not by MB1B) using mvt type 321.The material doc gets created by the BAPI,but actual stock posting is not taking place ie.the stock doesn’t get reflected in QA33/32 and QA11 also .Can any one suggest what must be wrong?The inputs given are as follows:
GOODSMVT_HEADER:
PSTNG_DATE =30/07/2014, DOC_DATE = 30/07/2014, REF_DOC_NO = INSP LOT NO.
GOODSMVT_CODE:
GM_CODE: ‘04’ .
GOODSMVT_ITEM:
MATERIAL = MATERIAL NO
PLANT = PLANTCODE
STGE_LOC = ‘WIP’
BATCH = BATCHNO
MOVE_TYPE = ‘321’
ENTRY_QNT = 100
ENTRY_UOM = ‘EA’
ORDERID = Prd ord no.
After executing this I used BAPI_TRANSACTION_COMMIT also. I am able to see the posted qty in MMBE,but it is not reflecting in QA11/33/32.
Kindly help me.Hi Naveen,
Thanks for the reply. Even after using FM QAVE_PROCESS_AUTO_UD,when i execute
BAPI_GOODSMVT_CREATE, the same thing is happening.I am unable to see the stock deducted in QA33.
Is there any input in the goods mvt bapi where we can provide inspection lot no since i believe that the goods mvt has to get connected with the inspection lot. -
Problem using BAPI for Final Invoice Tick
Hi,
I am using the BAPI BAPI_PO_CHANGE to set the Final invoice flag in a PO line item. But the call throws up various kinds of errors.
Are there any mandatory parameters that I may have missed out for the updation of this particular field.
Thanks in advance,
AshishHi,
As per my knowledge the following parameters are required.
PURCHASEORDER
POHEADER
POHEADERX
RETURN
POITEM
POITEMX
There is very good function module documentation available for the BAPI.
Open the function module in SE37 and click documentation.
YOu will see example also.
Thanks
Ramakrishna -
Problem of BOM components uploading through BAPI,for the Network(CN01)
Hello,Friends,
Iam PP consultant and facing a problem of BOM components uploading through BAPI,for creating of the Network (CN21)
we have 300 components in the network activity and while uploading the BOM through BAPI , only 295 components has been uploaded.Others components has not uploaded.
Please suggest me what will be the Problem? and
What is the solution for the same?
Regards,
MYSin customizing availability checked has been applied ,for this reason one additional screen is appearing in BAPI for all these components
How this screen could be by passed -
Problem in creating a bapi for bom
hai all,
i am trying to create a bapi for bom using csap_mat_bom_create, but it am getting sy-subrc value as 1.
and displaying error message as the function module name itself.
is there any solution dor it.Hello,
Try to use that bapi :
BAPI_MATERIAL_BOM_GROUP_CREATE
Thierry -
BAPI for ABZU - Asset Write UP
Hi
I need to post asset write up documents through ABZU tcode. Can any one help me out with the appropriate BAPI for the same.
BDC will not solve my problem as the set of screen changes as per the 'Transaction Type'.
Regards,
Sudip Kumar Das.Write up is allowed only to the extent of accumulated depreciation from previous years. You can do write up "ABZU". however the accumulated depriciation balance has to carry forward from last fiscal year to current fiscal year and you can do writeup only upto the accumulated depr from the previous yr
-
BAPI FOR Deleting a Schedule Line Item from EKES and EKET tables
Dear All,
I would like to for deleting one of the line item from EKES (Po Confirmation ) and the respective line item from the EKET(PO Schedule Line Item Table).
Assume that am allowing the user to select the lineitem from zprogram screen and collecting the PO and Its LIne Item details in an internal table.
Can i Use
<b>BAPI_PO_Change</b> , if so , can anybody tell me the steps to follow to use this bapi for deleting the PO lineItems, since i m going to try BAPI for First time.
pls help me out
Message was edited by: Raja K.PHi raja ,
loop at iekko1.
w_index = sy-tabix.
item-po_item = itemx-po_item = iekko1-ebelp.
item-quantity = iekko1-mng01.
itemx-quantity = iekko1-mng01.
if iekko1-wamng = iekko1-wemng.
itemx-no_more_gr = item-no_more_gr = 'X'.
else.
itemx-no_more_gr = item-no_more_gr = ''.
endif.
append item.
append itemx.
clear return[].
call function 'BAPI_PO_CHANGE'
exporting
purchaseorder = iekko1-ebeln
tables
return = return
poitem = item
poitemx = itemx.
if return[] is initial.
commit work and wait.
call function 'DEQUEUE_ALL'.
search for deletion fields which u have to mark 'X'.
before calling this BAPi u have to lock the PO by using ENQUEUE.
<b>
FU BAPI_PO_CHANGE
Text
Change purchase order
Functionality
Function module BAPI_PO_CHANGE enables you to change purchase orders. The Change method uses the technology behind the online transaction ME22N.
Alternatively, the IDoc type PORDCH1 is available. The data from this IDoc populates the interface parameters of the function module BAPI_PO_CHANGE.
Functionality in Detail
Authorization
When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked:
M_BEST_BSA (document type in PO)
M_BEST_EKG (purchasing group in PO)
M_BEST_EKO (purchasing organization in PO)
M_BEST_WRK (plant in PO)
Controlling adoption of field values via X bar
For most tables, you can use your own parameters in the associated X bar (e.g. PoItemX) to determine whether fields are to be set initial, values inserted via the interface, or default values adopted from Customizing or master records, etc. (for example, it is not mandatory to adopt the material group from an underlying requisition - you can change it with the BAPI).
Transfer
Purchase order number
The PurchaseOrder field uniquely identifies a purchase order. This field must be populated in order to carry out the Change method.
Header data
The header data of the Enjoy purchase order is transferred in table PoHeader.
Item data
The item data of the Enjoy purchase order is stored in the tables PoItem (general item data). Changes regarding quantity and delivery date are to be made in the table PoSchedule.
Use the table PoAccount to change the account assignment information.
Services and limits
Changes to existing items cannot be carried out with the Change method. It is only possible to create new items.
Conditions
Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. A new price determination process can be initiated via the parameter CALCTYPE in the table PoItem.
Vendor and delivery address
The vendor address in the table PoAddrVendor and the delivery address in the table PoAddrDelivery can only be replaced by another address number that already exists in the system (table ADRC). Changes to address details can only be made using the method BAPI_ADDRESSORG_CHANGE.
Partner roles
You can change all partners except the partner role "vendor" via the table PoPartner.
Export/import data
Export/import data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items. Changes to the export/import data of existing items are not possible.
Texts
Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText. Texts can only be replaced completely.
Version Management
You can make use of the Version Management facility via the table AllVersions.
Return
If the PO was changed successfully, the header and item tables are populated with the information from the PO.
Return messages
Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
Restrictions
With this function module, it is not possible to:
Create subcontracting components (you can only use existing ones)
Create configurations (you can only use existing ones)
Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
Attach documents to the purchase order
Change foreign trade data
Change service data
Change or reexplode BOMs
A firewall prevents the manipulation of data that is not changeable in Purchasing according to the business logic of the purchase order (e.g. PO number, vendor, etc.).
PO items with an invoicing plan cannot be created or changed using the BAPIs
In this connection, please refer to current information in Note 197958.
To change addresses with numbers from Business Address Services (cantral address management), please use the function module BAPI_ADDRESSORG_CHANGE.
To change variant configurations, please use the function module BAPI_UI_CHANGE. More information is available in the BAPI Explorer under the Logistics General node.
In the case of changes that are to be made via the BAPI_PO_CHANGE, a firewall first checks whether the relevant fields are changeable. This approach follows that of the online transaction. Here it is not possible to change the vendor or the document type, for example.
Example
Example of changes made to a purchase order with:
1. Change in header data
2. Change in item
3. Change in delivery schedule
4. Change in account assignment
5. Change in conditions
6. Change in partners
Parameter: PURCHASEORDER 4500049596
Parameter: POHEADER
PMNTTRMS = 0002
PUR_GROUP = 002
Parameter: POHEADERX
PMNTTRMS = X
PUR_GROUP = X
Parameter: POITEM
PO_ITEM = 00001
CONF_CTRL = 0001
Parameter: POITEMX
PO_ITEM = 00001
PO_ITEMX = X
CONF_CTRL = X
Parameter: POSCHEDULE
PO_ITEM = 00001
SCHED_LINE = 0001
QUANTITY = 10.000
PO_ITEM = 00001
SCHED_LINE = 0003
DELETE_IND = X
Parameter: POSCHEDULEX
PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0003
PO_ITEMX = X
SCHED_LINEX = X
DELETE_IND = X
Parameter: POACCOUNT
PO_ITEM = 00001
SERIAL_NO = 01
GL_ACCOUNT = 0000400020
Parameter: POACCOUNTX
PO_ITEM = 00001
SERIAL_NO = 01
PO_ITEMX = X
SERIAL_NOX = X
GL_ACCOUNT = X
Parameter: POCOND
ITM_NUMBER = 000001
COND_TYPE = RA02
COND_VALUE = 2.110000000
CURRENCY = %
CHANGE_ID = U
Parameter: POCONDX
ITM_NUMBER = 000001
COND_ST_NO = 001
ITM_NUMBERX = X
COND_ST_NOX = X
COND_TYPE = X
COND_VALUE = X
CURRENCY = X
CHANGE_ID = X
Parameter: POPARTNER
PARTNERDESC = GS
LANGU = EN
BUSPARTNO = 0000001000
Help in the Case of Problems
1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
Customer Enhancements
The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
EXIT_SAPL2012_001 (at start of BAPI)
EXIT_SAPL2012_003 (at end of BAPI)
The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
EXIT_SAPL2012_002 (at start of BAPI)
EXIT_SAPL2012_004 (at end of BAPI)
These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
Further Information
1. Note 197958 contains up-to-date information on the purchase order BAPIs.
2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
Parameters
PURCHASEORDER
POHEADER
POHEADERX
POADDRVENDOR
TESTRUN
MEMORY_UNCOMPLETE
MEMORY_COMPLETE
POEXPIMPHEADER
POEXPIMPHEADERX
VERSIONS
NO_MESSAGING
NO_MESSAGE_REQ
NO_AUTHORITY
NO_PRICE_FROM_PO
EXPHEADER
EXPPOEXPIMPHEADER
RETURN
POITEM
POITEMX
POADDRDELIVERY
POSCHEDULE
POSCHEDULEX
POACCOUNT
POACCOUNTPROFITSEGMENT
POACCOUNTX
POCONDHEADER
POCONDHEADERX
POCOND
POCONDX
POLIMITS
POCONTRACTLIMITS
POSERVICES
POSRVACCESSVALUES
POSERVICESTEXT
EXTENSIONIN
EXTENSIONOUT
POEXPIMPITEM
POEXPIMPITEMX
POTEXTHEADER
POTEXTITEM
ALLVERSIONS
POPARTNER
Exceptions
Function Group
2012
</b>
regards
prabhu
Message was edited by: Prabhu Peram -
Hi....
I'm using BAPI_ACC_DOCUMENT_POST to clear vendor open items for the T-code f-44.The following is my below code and it seems to be going on fine but the data in the table bsak(Vendor accounts cleared items) is not updated..with the concern vendor number and documnet no....more over when i'm checking this FM the document post perform is displaying an erro RW with number 604.......in the return internal table.....what wud be the problem for this i'm posting my coding below plz suggest me for this......Is the Bapi correct for the concern document......
*& Report Z_TEST_F44 *
REPORT z_test_f44 NO STANDARD PAGE HEADING
LINE-COUNT 65
LINE-SIZE 132
MESSAGE-ID zfi.
*tables: bsik.
TYPES: BEGIN OF tp_tab_bsik,
bukrs TYPE bukrs,
lifnr TYPE lifnr,
gjahr TYPE gjahr,
budat TYPE budat,
bldat TYPE bldat,
blart TYPE blart,
bschl TYPE bschl,
END OF tp_tab_bsik.
DATA: l_tab_bsik TYPE tp_tab_bsik OCCURS 10.
DATA: l_wa_tab_bsik TYPE tp_tab_bsik.
DATA:BEGIN OF it_account_tab OCCURS 0,
line(255),
END OF it_account_tab.
DATA:
g_fis_period(2) TYPE c,
g_clear_date(10) TYPE c,
g_accountno(10) TYPE c,
g_currencytype(3) TYPE c,
g_docno(10) TYPE c,
g_amount(13) TYPE c,
g_sign TYPE c,
g_pstkey(2) TYPE c,
g_companycode(4) TYPE c.
DATA:
it_error_acc_tab LIKE it_account_tab OCCURS 0 WITH HEADER LINE.
*include bdcrecxx.
--Start of Selection Parameters--
SELECTION-SCREEN:BEGIN OF BLOCK blck01 WITH FRAME TITLE text-001.
PARAMETERS:
p_fname LIKE rlgrap-filename,
p_fserv LIKE rlgrap-filename.
SELECTION-SCREEN:END OF BLOCK blck01.
--End of Selection Parameters--
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'DATASET'
IMPORTING
file_name = p_fname.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fserv.
DATA:
l_pfad LIKE ibipparms-path.
CALL FUNCTION 'F4_FILENAME_SERVER'
EXPORTING
pfad = l_pfad
IMPORTING
file_name = p_fserv
EXCEPTIONS
no_file_on_server = 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.
--START OF SELECTION--
START-OF-SELECTION.
PERFORM get_data_bsik.
PERFORM get_default_data. "Getting the default data
PERFORM get_input_data. "Uploading the file data
PERFORM format_input_data. "Formating the data
PERFORM process_data. "Posting using F-44(Bapi)
IF it_error_acc_tab[] IS INITIAL.
MESSAGE i001(ztest).
ENDIF.
END-OF-SELECTION.
--End OF SELECTION--
*& Form get_default_data
text
--> p1 text
<-- p2 text
FORM get_default_data.
ENDFORM. " get_default_data
*& Form get_input_data
text
--> p1 text
<-- p2 text
FORM get_input_data.
DATA:
l_fname TYPE string,
l_dsn(128) TYPE c,
l_rec(80) TYPE c.
l_fname = p_fname.
IF NOT l_fname IS INITIAL.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_fname
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_account_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
BREAK-POINT.
l_dsn = p_fserv.
OPEN DATASET l_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc <> 0.
EXIT.
ENDIF.
READ DATASET l_dsn INTO l_rec.
APPEND it_account_tab.
WHILE sy-subrc <> 0.
READ DATASET l_dsn INTO l_rec.
APPEND it_account_tab.
ENDWHILE.
CLOSE DATASET l_dsn.
ENDIF.
ENDFORM. " get_input_data
*& Form format_input_data
text
--> p1 text
<-- p2 text
FORM format_input_data.
SORT it_account_tab.
ENDFORM. " format_input_data
*& Form process_data
text
--> p1 text
<-- p2 text
FORM process_data.
DATA:
l_documentheader LIKE bapiache09,
l_accountgl LIKE bapiacgl09 OCCURS 2 WITH HEADER LINE,
l_vendoritem LIKE bapiacap09 OCCURS 2 WITH HEADER LINE,
l_currencyamount LIKE bapiaccr09 OCCURS 2 WITH HEADER LINE,
l_currencytype LIKE bapiaccr09-currency_iso,
l_return LIKE bapiret2 OCCURS 5 WITH HEADER LINE,
l_obj_type LIKE bapiache02-obj_type,
l_obj_key LIKE bapiache02-obj_key,
l_obj_sys LIKE bapiache02-obj_sys.
LOOP AT it_account_tab.
CLEAR:
g_fis_period,
g_clear_date,
g_accountno,
g_amount,
g_sign,
l_documentheader,
l_vendoritem,
l_accountgl,
l_wa_tab_bsik,
l_currencyamount,
l_return.
REFRESH:l_vendoritem,
l_currencyamount,
l_return.
g_accountno = it_account_tab-line+0(10).
g_clear_date = it_account_tab-line+11(10).
g_fis_period = it_account_tab-line+22(2).
g_companycode = it_account_tab-line+25(4).
g_docno = it_account_tab-line+30(10).
g_pstkey = it_account_tab-line+41(2).
g_amount = it_account_tab-line+44(13).
g_currencytype = it_account_tab-line+58(3).
IF sy-subrc <> 0.
MOVE-CORRESPONDING it_account_tab TO it_error_acc_tab.
APPEND it_error_acc_tab.
CLEAR it_error_acc_tab.
CONTINUE.
ENDIF.
READ TABLE l_tab_bsik INTO l_wa_tab_bsik WITH KEY bukrs = g_companycode
lifnr = g_accountno.
l_documentheader-obj_type = 'BKPFF'.
l_documentheader-obj_key = sy-uzeit.
l_documentheader-obj_sys = 'ABAPEML2'.
l_documentheader-bus_act = 'RFBU'.
l_documentheader-ac_doc_no = g_accountno.
l_documentheader-username = sy-uname.
l_documentheader-comp_code = g_companycode.
l_documentheader-fis_period = g_fis_period(2).
l_documentheader-doc_date = g_clear_date.
l_documentheader-pstng_date = g_clear_date.
l_documentheader-fisc_year = l_wa_tab_bsik-gjahr.
l_documentheader-doc_type = l_wa_tab_bsik-blart.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = g_accountno
IMPORTING
output = g_accountno.
l_accountgl-itemno_acc = '2'.
l_accountgl-gl_account = g_accountno.
l_accountgl-comp_code = g_companycode.
l_accountgl-pstng_date = sy-datum.
l_accountgl-doc_type = l_wa_tab_bsik-blart.
l_accountgl-ac_doc_no = g_accountno.
APPEND l_accountgl.
l_vendoritem-itemno_acc = '2'.
l_vendoritem-vendor_no = g_accountno.
l_vendoritem-comp_code = g_companycode.
APPEND l_vendoritem.
l_currencyamount-itemno_acc = '2'.
l_currencyamount-currency_iso = g_currencytype.
l_currencyamount-amt_doccur = g_amount.
IF g_sign = '-'.
l_currencyamount-amt_doccur = l_currencyamount-amt_doccur * -1.
ENDIF.
APPEND l_currencyamount.
*CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = l_documentheader
IMPORTING
obj_key = l_obj_key
TABLES
accountgl = l_accountgl
accountpayable = l_vendoritem
currencyamount = l_currencyamount
return = l_return.
IF l_obj_key NE '$'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
MOVE-CORRESPONDING it_account_tab TO it_error_acc_tab.
APPEND it_error_acc_tab.
CLEAR it_error_acc_tab.
ENDIF.
ENDLOOP.
ENDFORM. "process_data
*& Form get_data_bsik
text
--> p1 text
<-- p2 text
FORM get_data_bsik.
SELECT bukrs
lifnr
gjahr
budat
bldat
blart
bschl
FROM bsik INTO TABLE l_tab_bsik.
ENDFORM. " get_data_bsik
Points wud be surely awarded....................hi kiran....
this bapi will get all the open items from <b>bsik</b> and will show us the open items but i want the bapi for clearing this open items and post it in the<b> bsak</b> table.And more over this is concerned with the Customer side ie bsad and bsid(clear items) tables.........Will this work?????????
Thanks......... -
Function Module / BAPI for Inbound Delivery from Purchase Order
Hi,
I need to create an inbound delivery from Purchase Order items and am looking out for some Function Module or BAPI for the same.
The requirement is that i should be able to specify selected line items from PO for delivery.
I tried the BDC method for VL31N , but the particular item selection is problem, since by default it shows all the items of PO and i want only selected items.
Do reply.
Thanks in advance.check these and their documentations.
BAPI_INB_DELIVERY_CHANGE Change inbound delivery
BAPI_INB_DELIVERY_CONFIRM_DEC BAPI for inbound delivery verification from a decentralized system
BAPI_INB_DELIVERY_SAVEREPLICA BAPI Function Module for Replication of Inbound Deliveries
Regards
Prabhu -
Hi Friends,
I am having a problem in BAPI when i am executing the program i am getting a error message like this,
<b>Error message:</b>
144The field MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO) is defined as a required field; it does not contain an entry .
any solutions to the above problem.
I am sending the code along with this mail.
<b>coding:</b>
REPORT ZYC_BAPI_MATERIAL_CREATE .
STRUCTURE DECLARATIONS *
TABLES: BAPIMATHEAD, "Headerdata
BAPI_MARA, "Clientdata
BAPI_MAKT, "Material description
BAPIRET2. "Return messages
data : bapi_mara1 LIKE bapi_mara. "Client Data
DATA:V_FILE TYPE STRING.
DATA:
BEGIN OF LSMW_MATERIAL_MASTER,
MATNR(018) TYPE C, "Material number
MBRSH(001) TYPE C, "Industry sector
MTART(004) TYPE C, "Material type
MAKTX(040) TYPE C, "Material description
MEINS(003) TYPE C, "Base unit of measure
END OF LSMW_MATERIAL_MASTER.
INTERNAL TABLE DECLARATIONS *
*to store the input data
DATA: BEGIN OF it_matmaster OCCURS 0.
INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
DATA: END OF it_matmaster.
*for material description
DATA:BEGIN OF IT_MATERIALDESC OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT .
DATA:END OF IT_MATERIALDESC.
*to return messages
DATA:BEGIN OF IT_RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA:END OF IT_RETURN.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1 .
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
TO UPLOAD THE DATA *
START-OF-SELECTION.
V_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = V_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = IT_MATMASTER
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA POPULATIONS *
LOOP AT IT_MATMASTER.
BAPIMATHEAD-MATERIAL = IT_MATMASTER-MATNR.
BAPIMATHEAD-IND_SECTOR = IT_MATMASTER-Mbrsh.
BAPIMATHEAD-MATL_TYPE = IT_MATMASTER-MTART.
BAPIMATHEAD-BASIC_VIEW = 'X'.
refresh it_materialdesc.
IT_MATERIALDESC-matl_desc = IT_MATMASTER-maktx.
append IT_materialdesc.
bapi_mara1-base_uom = 'TO'. "it_matmaster-meins.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = BAPIMATHEAD
CLIENTDATA = BAPI_MARA
CLIENTDATAX = BAPI_MARAx
IMPORTING
RETURN = IT_RETURN
TABLES
MATERIALDESCRIPTION = IT_MATERIALDESC.
WRITE:/ IT_RETURN-TYPE,
2 IT_RETURN-ID,
22 IT_RETURN-NUMBER,
25 IT_RETURN-MESSAGE.
ENDLOOP.
Regards,
DineshHi
Basic Unit of Measure is required field in the material master
You are not populating it in the Bapi
populate it in the CLIENTDATA
IT WILL SOLVE THE ISSUE.
CLIENTDATA-BASE_UOM = it_matmaster-meins
Reward points if useful
Regards
Anji -
Problem with BAPI BAPI_REQUISITION_CREATE
Hello,
I have problems with BAPI BAPI_REQUISITION_CREATE. I need to create Purchase requisition for services. If I use BAPI BAPI_REQUISITION_CREATE, Purchasing requisition is created, but field NETWR in table EBNK is 0. If I create purchasing requisition manualy using transaction ME51N, field NETWR in table EBNK is filled with correct price.
Can you pls. help me, what do I wrong in calling BAPI_REQUISITION_CREATE?
Thanks®ards,
JirkaNot sure if you got your answer or went to OSS for a resolution. But, as I was searching OSS for my issue, I came across the following note:
Note 1498435 - BAPI_REQUISITION_CREATE: EBKN-NETWR is not updated -
Dear all,
I need a help in webdynpro using bapi scenario
-> my form has 6 input fields, in that 4 are drop down boxes which gets the value from respective 4 bapis.
-> 2 input fields should be in date picker which didnt get value from bapi
-> another table which is connected to bapi for ouput uses all the 6 fields as input
now my problem is, i can take the first 4 dropdown boxes values as input to grid, but i couldnt take the last 2 fields(dates) as input to it.
To make the field as date picker we need to create a structure in Dictionary object. There is no date picker to select from "Insert Child" option. that is if the type is date then it automatically makes the inputfield as date picker.Dear Lohi,
I didnt get you what you are saying... i am not importing and Fn Module... its actually a WSDL iam importing it through WD wizards.....
After importing it i need to pass 6 fields as input.....i have 4 fields of inputs which are output of 4 another wsld. i can map that 4 outputs of 4 different WSDLs to input of Grid WSDL.
the problem here is.... another two fields those are date fields i need to send to Grid WSDL as input, if i directly create valuenodes in the context, and map to fields as input to Grid WSDL the output giving error.
Hope you understud my problem..... please help me out in this regard -
We have developed a bdc for t-code MB01. We want to genreate material documents in background. For some reasons we are not in a position to use BAPI for MIGO (as we are not able to input data of two fields). we are on ECC 6.0
BDC for MB01 is working fine. Only thing is we want to input "Goods recipient" also in this bdc. But we are not able to find this field in MB01. is it possible to get goods recipient also in MB01? how to do it?
Also is there any problem in using bdc for MB01 instead of MIGO?Hello,
try LSMW with Object 0110 - Material movement.
You can develop standard LSMW for this object in half an hour.
Andrzej
Maybe you are looking for
-
No smart cover unlock option iPad 3?
I am looking in the "General" setting for my iPad 3 and there is no option for the Smart cover unlock feature? My sisters iPad 2, iOS 5.1, has the feature so why wouldn't the iPad 3 have it?
-
I've had my Blackberry Curve 8330 (Verizon wireless) for just over a month. Everyday my Blackberry doesn't receive some of my emails. Here's an example of what happens. I get of my emails sent to my blackberry & usually look at the right way, the
-
How to pass Parameter to Oracle Report from portal
Dear All I create a report use Oracle Report, and the file name is "Account.rdf" This report have a start date parameter and a end date parameter. I put this report to the report server, and then add a new entry to the cgicmd.dat file, so i enter the
-
Maintain the variants for the deletion program
How to Maintain the variants for the deletion program during Document Archiving
-
I have a 14 inch iBook, and recently figured out that my hard drive is bad. I can get on it, but the s.m.a.r.t. status is "failing". Anyways, I got a new external hard drive and I want to install Panther onto it, but the 1st disk is very scratched up