[HELP] ExtensionIn ---- BAPI_CATIMESHEETMGR_INSERT
Hi All,
Kindly please help me on BAPI_CATIMESHEETMGR_INSERT. I already inserted my custom field COUNTRY to Table CATSDB. I would like to post my entries with my inserted field COUNTRY. I already read the BAPI manual :
ExtensionIn
Customer enhancement import
Description
If you defined additional customer fields in your external application or external system as well as in the SAP System and you want to transfer data from them to the SAP System, you can use this import table. The additional customer fields are reproduced in the customer-specific fields in the CATSDB table using the BAPI_TE_CATSDB structure.
You should enter the name of the structure in the STRUCTURE field. The contents of the BAPI_TE_CATSDB structure is contained in the data part. The data part of this table must be structured analogously to the BAPI_TE_CATSDB structure. The first 10 characters of the data part are for the line numbers. The customer fields are linked to the corresponding data record in the CATSRECORDS_IN table using the line numbers.
>>What are the first 10 characters that I should input? Please. Please help me on this.
Thanks.
Well this is what I think on this.
You have to pass name of the table (say t1) of type BAPI_TE_CATSDB to the Structure EXTENSIONIN
so now t1 will contain the data which will obviously have the corresponding Extension data for the main table CATSDB. But there has to be some way to identify which row of CATSRECORDS_IN matches to row of BAPI_TE_CATSDB record. The first 10 char are supposed to do this linking.
Similar Messages
-
HELP bout EXTENSIONIN in BAPI_PO_CHANGE
I want to use 'BAPI_PO_CHANGE' to update PO items by passing EXTENSIONIN in unicode system ECC6.0. I have update the structure of BAPI_TE_MEPOITEMX and CI_EKPODBX.
Here's my code, no error, but the value didn't change.Is anything wrong with my code?
Thanks.
DATA:
it_extensionin TYPE STANDARD TABLE OF BAPIPAREX,
wa_extensionin TYPE BAPIPAREX,
BAPI_TE_MEPOITEM LIKE BAPI_TE_MEPOITEM,
BAPI_TE_MEPOITEMX LIKE BAPI_TE_MEPOITEMX.
BAPI_TE_MEPOITEM-ZZ_COMM_STO_NUM = '111'.
wa_extensionin-structure = 'BAPI_TE_MEPOITEM'.
wa_extensionin-valuepart1(5) = '00010'.
*that's the value i want to update
wa_extensionin-valuepart1+5(10) = BAPI_TE_MEPOITEM-ZZ_COMM_STO_NUM.
wa_extensionin- valuepart1+15(10) = ''.
wa_extensionin-valuepart1+25(8) = ''.
wa_extensionin-valuepart1+33(8) = ''.
wa_extensionin-valuepart1+41(8) = ''.
wa_extensionin-valuepart1+49(8) = ''.
wa_extensionin-valuepart1+57(1) = ''.
APPEND wa_extensionin to it_extensionin.
wa_extensionin-structure = 'BAPI_TE_MEPOITEMX'.
wa_extensionin-valuepart1(5) = '00010'.
wa_extensionin-valuepart1+5(1) = 'X'.
wa_extensionin-valuepart1+6(1) = ''.
wa_extensionin-valuepart1+7(1) = ''.
wa_extensionin-valuepart1+8(1) = ''.
wa_extensionin-valuepart1+9(1) = ''.
wa_extensionin-valuepart1+10(1) = ''.
APPEND wa_extensionin to it_extensionin.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = '4100000533'
TABLES
RETURN = IT_RETURN
EXTENSIONIN = it_extensionin.
Edited by: yang Aiolos on Oct 10, 2008 2:54 AM
Edited by: yang Aiolos on Oct 10, 2008 2:59 AMHi..
I am not sure if you have missed something in the extension structure.... what you can do is check by trial and error method by passing values to other fields also.. many times it so happens that you may need to pass values to some particular fields to update values of some other field....
regards,
Madan... -
BAPI_CATIMESHEETMGR_INSERT - Can't get SHORTTEXT (LTXA1) updated
I'm using BAPI_CATIMESHEETMGR_INSERT (for the first time) and it is successfully inserting new CATS records - with the exception of the short text field (ltxa1). I've run the program in debug mode and the SHORTTEXT field within my internal table for the import BAPICATS1 table (named tbl_catsdata_in) has the SHORTTEXT value populated, but after the BAPI call, the field is not updated in the corresponding BAPICATS2 export table (named tbl_catsdata_out in my program).
Is there something special I need to know about getting values to store in the CATSDB LTXA1 field? All other fields are storing just fine. I am explicitly moving a value to the field. I'm baffled.
Here are excerpts from the program:
tbl_inserts-abs_att_type = tbl_zlct_to-awart.
tbl_inserts-bonustype = tbl_zlct_to-prakn.
tbl_inserts-employeenumber = tbl_zlct_from-empl.
tbl_inserts-rec_cctr = tbl_zlct_to-rkostl.
tbl_inserts-rec_order = tbl_zlct_to-raufnr.
Storing the LCT-ID in the new records short text field.
tbl_inserts-shorttext = tbl_zlct_to-lct_id.
loop at tbl_inserts where lct_id = v_hold_lct_id.
move-corresponding tbl_inserts to tbl_catsdata_in.
append tbl_catsdata_in.
endloop.
loop at tbl_cust_fields where lct_id = v_hold_lct_id.
tbl_extensionin-structure = 'BAPI_TE_CATSDB'.
bapi_te_catsdb-row = tbl_cust_fields-recno.
bapi_te_catsdb-zoan = tbl_cust_fields-zoan.
bapi_te_catsdb-zzminclss = tbl_cust_fields-zzminclss.
bapi_te_catsdb-zzcostcntr = tbl_cust_fields-zzcostcntr.
bapi_te_catsdb-ztaskid = tbl_cust_fields-ztaskid.
tbl_extensionin+30 = bapi_te_catsdb.
append tbl_extensionin.
endloop.
call function 'BAPI_CATIMESHEETMGR_INSERT'
exporting
profile = 'AUTOAPP2' "Profile
testrun = v_no_upd "Test
release_data = p_releas "Release Data
AGENT =
TEXT_FORMAT_IMP = 'ITF'
tables
catsrecords_in = tbl_catsdata_in
extensionin = tbl_extensionin
catsrecords_out = tbl_catsdata_out
extensionout = tbl_extensionout
WORKFLOW_TEXT =
return = tbl_return
LONGTEXT =
Thanks in advance for your help.Marking this question as answered. We found another alternative..did not use the SHORTETEXT field.
-
Need help in using FM BAPI_MATERIAL_SAVEDATA
Gurus,
I need help in using the FM BAPI_MATERIAL_SAVEDATA. The FM is returning a message that says "The field MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO) is defined as a required field; it does not contain an entry".
I have supplied the necessary details and yet the FM won't push through.
If possible, please post sample codes.
Below is my sample code:
===============================================
REPORT zmm_materialupload.
eject
$$******************************************************************************
$$ TYPES
$$******************************************************************************
eject
$$******************************************************************************
$$ INTERNAL TABLES (custom structure
$$******************************************************************************
eject
$$******************************************************************************
$$ RANGES
$$******************************************************************************
eject
$$******************************************************************************
$$ FIELD-SYMBOLS
$$******************************************************************************
eject
$$******************************************************************************
$$ PARAMETERS & SELECT-OPTIONS
$$******************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
*SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_mtart FOR mara-mtart.
SELECT-OPTIONS: s_mbrsh FOR mara-mbrsh DEFAULT 'P'.
SELECT-OPTIONS: s_werks FOR marc-werks DEFAULT '1000' OBLIGATORY.
SELECT-OPTIONS: s_lgort FOR marc-lgpro DEFAULT 'OPSL' OBLIGATORY.
PARAMETERS: p_path LIKE rlgrap-filename DEFAULT 'C:\Documents and Settings\training_11\Desktop\Book4 (2ITEMS).txt' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK 1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FNAME'
IMPORTING
file_name = p_path.
eject
$$******************************************************************************
$$ START-OF-SELECTION
$$******************************************************************************
START-OF-SELECTION.
PERFORM check_input.
PERFORM get_file.
PERFORM filter_input.
PERFORM populate_tabs.
PERFORM bapi_mat.
eject
$$******************************************************************************
$$ FORMS
$$******************************************************************************
FORM bapi_mat.
LOOP AT it_tab INTO wa_tab.
CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
EXPORTING
material_type = wa_tab-mtart
industry_sector = wa_tab-mbrsh
required_numbers = 1
TABLES
material_number = it_matnr.
ENDLOOP.
LOOP AT it_matnr INTO wa_matnr.
READ TABLE it_tab INTO wa_tab INDEX sy-tabix.
wa_tab-matnr = wa_matnr-material.
MODIFY it_tab FROM wa_tab INDEX sy-tabix.
ENDLOOP.
PERFORM populate_tabs.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = it_headdata
clientdata = it_clientdata
clientdatax = it_clientdatax
plantdata = it_plantdata
plantdatax = it_plantdatax
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
valuationdata = it_valuationdata
valuationdatax = it_valuationdatax
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA =
SALESDATAX =
STORAGETYPEDATA =
STORAGETYPEDATAX =
flag_online = ' '
flag_cad_call = ' '
NO_DEQUEUE = ' '
NO_ROLLBACK_WORK = ' '
IMPORTING
return = it_return
TABLES
materialdescription = it_materialdescription
unitsofmeasure = it_unitsofmeasure
unitsofmeasurex = it_unitsofmeasurex
internationalartnos = it_internationalartnos
materiallongtext = it_materiallongtext
taxclassifications = it_taxclassifications
returnmessages = it_returnmessages
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
IF sy-subrc = 0.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = it_return.
ENDFORM. "bapi_mat
*& Form GET_FILE
text
FORM get_file.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = 'Getting data from file...'.
MOVE: p_path TO gv_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = gv_file
filetype = 'ASC'
has_field_separator = 'X'
read_by_line = 'X'
TABLES
data_tab = it_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.
ENDFORM. "GET_FILE
*& Form check_input
text
FORM check_input.
Material Type
IF s_mtart-low IS INITIAL AND s_mtart-high IS INITIAL.
s_mtart = 'IEQ'.
s_mtart-low = 'ABF'. "Waste
s_mtart-high = 'ZTRD'. "Stock Items
APPEND s_mtart.
ENDIF.
IF s_mtart-low IS NOT INITIAL AND s_mtart-high IS INITIAL.
MOVE: s_mtart-low TO s_mtart-high.
ENDIF.
Industry Sector
IF s_mbrsh-low IS INITIAL AND s_mbrsh-high IS INITIAL.
s_mbrsh = 'IEQ'.
SELECT mbrsh
FROM mara
INTO TABLE it_mbrsh.
s_mbrsh-low = wa_mbrsh-mbrsh.
LOOP AT it_mbrsh INTO wa_mbrsh.
s_mbrsh-high = wa_mbrsh-mbrsh.
ENDLOOP.
APPEND s_mbrsh.
ENDIF.
IF s_mbrsh-low IS NOT INITIAL AND s_mbrsh-high IS INITIAL.
MOVE: s_mbrsh-low TO s_mbrsh-high.
ENDIF.
Plant
IF s_werks-low IS INITIAL AND s_werks-high IS INITIAL.
s_werks = 'IEQ'.
s_werks-low = '1000'.
s_werks-high = '2000'.
ENDIF.
IF s_werks-low IS NOT INITIAL AND s_werks-high IS INITIAL.
MOVE: s_werks-low TO s_werks-high.
ENDIF.
Storage Location
IF s_lgort-low IS NOT INITIAL AND s_lgort-high IS INITIAL.
MOVE: s_lgort-low TO s_lgort-high.
ENDIF.
ENDFORM. "check_input
*& Form Filter_input
text
FORM filter_input.
SORT it_tab BY matnr mtart mbrsh werks lgort.
LOOP AT it_tab INTO wa_tab.
IF wa_tab-mtart NOT IN s_mtart.
DELETE it_tab WHERE mtart NOT IN s_mtart.
ENDIF.
IF wa_tab-mbrsh NOT IN s_mbrsh.
DELETE it_tab WHERE mbrsh NOT IN s_mbrsh.
ENDIF.
IF wa_tab-werks NOT IN s_werks.
DELETE it_tab WHERE werks NOT IN s_werks.
ENDIF.
IF wa_tab-lgort NOT IN s_lgort.
DELETE it_tab WHERE lgort NOT IN s_lgort.
ENDIF.
ENDLOOP.
ENDFORM. "Filter_input
*& Form populate_tabs
text
FORM populate_tabs.
LOOP AT it_tab INTO wa_tab.
MOVE: wa_tab-matnr TO wa_headdata-material,
wa_tab-mbrsh TO wa_headdata-ind_sector,
wa_tab-mtart TO wa_headdata-matl_type,
'X' TO wa_headdata-basic_view,
'X' TO wa_headdata-sales_view,
'X' TO wa_headdata-purchase_view,
'X' TO wa_headdata-mrp_view,
'X' TO wa_headdata-account_view.
wa_tab-matkl TO wa_clientdata-matl_group,
wa_tab-meins TO wa_clientdata-base_uom,
wa_tab-groes TO wa_clientdata-size_dim,
wa_tab-gewei TO wa_clientdata-unit_of_wt,
wa_tab-ntgew TO wa_clientdata-net_weight,
'X' TO wa_clientdatax-matl_group,
'X' TO wa_clientdatax-base_uom,
'X' TO wa_clientdata-size_dim,
'X' TO wa_clientdatax-unit_of_wt,
'X' TO wa_clientdatax-net_weight,
wa_tab-werks TO wa_plantdata-plant,
wa_tab-ekgrp TO wa_plantdata-pur_group,
wa_tab-prctr TO wa_plantdata-profit_ctr,
wa_tab-werks TO wa_plantdatax-plant,
'X' TO wa_plantdatax-pur_group,
'X' TO wa_plantdatax-profit_ctr,
wa_tab-werks TO wa_valuationdata-val_area,
wa_tab-bklas TO wa_valuationdata-val_class,
wa_tab-peinh TO wa_valuationdata-price_unit,
wa_tab-verpr TO wa_valuationdata-moving_pr,
wa_tab-stprs TO wa_valuationdata-std_price,
wa_tab-xlifo TO wa_valuationdata-lifo_fifo,
wa_tab-werks TO wa_valuationdatax-val_area,
'X' TO wa_valuationdatax-val_class,
'X' TO wa_valuationdatax-price_unit,
'X' TO wa_valuationdatax-moving_pr,
'X' TO wa_valuationdatax-std_price,
'X' TO wa_valuationdatax-lifo_fifo.
APPEND wa_headdata TO it_headdata.
APPEND wa_clientdata TO it_clientdata.
APPEND wa_plantdata TO it_plantdata.
APPEND wa_valuationdata TO it_valuationdata.
MODIFY it_tab FROM wa_tab TRANSPORTING matnr.
ENDLOOP.
ENDFORM. "populate_tabs
$$******************************************************************************Hai.
check the below example.
REPORT z34332_bdc_create_material .
data: la_headdata type BAPIMATHEAD,
la_clientdata type BAPI_MARA,
la_CLIENTDATAX type BAPI_MARAX,
la_return type BAPIRET2.
data: i_materialdescription type table of BAPI_MAKT,
wa_materialdescription like line of i_materialdescription.
la_headdata-MATERIAL = '000000000000000004'.
la_headdata-IND_SECTOR = 'M'.
la_headdata-MATL_TYPE = 'FERT'.
la_clientdata-BASE_UOM = 'FT3'.
la_CLIENTDATAX-BASE_UOM = 'X'.
la_clientdata-MATL_GROUP = '01'.
la_CLIENTDATAX-MATL_GROUP = 'X'.
wa_materialdescription = 'TEST'.
append wa_materialdescription to i_materialdescription.
clear: wa_materialdescription.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = la_headdata
CLIENTDATA = la_clientdata
CLIENTDATAX = la_CLIENTDATAX
PLANTDATA =
PLANTDATAX =
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA =
VALUATIONDATAX =
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA =
SALESDATAX =
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
IMPORTING
RETURN = la_return
TABLES
MATERIALDESCRIPTION = i_materialdescription
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
write: la_return-TYPE, ',', la_return-MESSAGE.
clear: la_headdata, la_return, la_clientdata, la_clientdatax.
regards.
sowjanya.b. -
Error while updating time sheet with BAPI_CATIMESHEETMGR_INSERT
Hi Gurus,
We are uploading data from 3rd party software to SAP with Z program.
In this Z program using BAPI_CATIMESHEETMGR_INSERT.
While updating data manually with CAT2 or with BAPI, data is entered properly without any problem but while using the bapi in Z program error message " Version 0 is not set up for controlling area" is coming .
Hence Version 0 is already active for the controlling area for fiscal year 2010.
Please help me to resolve the issue.
Thanks,
Neha Duseja- First - Try to accomplish this via transaction CAT2 (*) (and then CATA or CAT6 to upload data to HR) - You may require some Customizing here ([Entry of Attendances and Absences for HR Time Management|http://help.sap.com/saphelp_bw/helpdata/en/64/400456470211d189720000e8322d00/frameset.htm])
- Then - Use the same values in [BAPI_CATIMESHEETMGR_INSERT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_catimesheetmgr_insert#sdn_content_category_value_wiki]
Regards,
Raymond
(*) Or ask to your functional -
Early help : BAPI_SALESORDER_SIMULATE- FREE GOODS - Warning Message
Hi Gurus,
I am using a BAPI : Z_BAPI_SALESORDER_SIMULATE , this Bapi is similar to the BAPI_SALESORDER_SIMULATE . It has customizations that are similar to the customizations done for order in the SAP system at my organization.
In the Output in the MESSAGETABLE I get the message
<b>
T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
Please help me with : What is the reason for this message? I am able to make a sale order with the same data
I am using exactly the same data in VA01 to create a sale order as I am using to test this BAPI: Z_BAPI_SALESORDER_SIMULATE</b>
Please help me at the earliest to solve this problem
BAPI INPUT :
ORDER_HEADER_IN OR
CONVERT_PARVW_AUART
Tables Value
ORDER_ITEMS_IN 1 Entry
ORDER_PARTNERS 2 Entries
ORDER_SCHEDULE_IN 1 Entry
ORDER_CONDITIONS_IN 0 Entries
ORDER_ITEMS_OUT 0 Entries
ORDER_CFGS_REF 0 Entries
ORDER_CFGS_INST 0 Entries
ORDER_CFGS_PART_OF 0 Entries
ORDER_CFGS_VALUE 0 Entries
ORDER_CFGS_BLOB 0 Entries
ORDER_CCARD 1 Entry
ORDER_CCARD_EX 0 Entries
ORDER_SCHEDULE_EX 0 Entries
ORDER_CONDITION_EX 0 Entries
ORDER_INCOMPLETE 0 Entries
MESSAGETABLE 0 Entries
EXTENSIONIN 0 Entries
PARTNERADDRESSES 1 Entry
WMDVSX 0 Entries
WMDVEX 0 Entries
Z_AVAIL_OUT 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
ORDER_ITEMS_IN2 0 Entries
ORDER_PARTNERS2 0 Entries
BAPI Output is :
Import parameters Value
ORDER_HEADER_IN OR I have this filled in
CONVERT_PARVW_AUART
DELAY 0
Export parameters Value
SALESDOCUMENT
ORDER_HEADER_EX OR
SOLD_TO_PARTY
SHIP_TO_PARTY
BILLING_PARTY
RETURN
ORDER_HEADER OR SO500750 00/00/0000 00/00/0000
Tables Value
ORDER_ITEMS_IN 1 Entry
Result: 1 Entry
ORDER_PARTNERS 2 Entries
Result: 2 Entries
ORDER_SCHEDULE_IN 1 Entry
Result: 1 Entry
ORDER_CONDITIONS_IN 0 Entries
Result: 0 Entries
ORDER_ITEMS_OUT 0 Entries
Result: 2 Entries
ORDER_CFGS_REF 0 Entries
Result: 0 Entries
ORDER_CFGS_INST 0 Entries
Result: 0 Entries
ORDER_CFGS_PART_OF 0 Entries
Result: 0 Entries
ORDER_CFGS_VALUE 0 Entries
Result: 0 Entries
ORDER_CFGS_BLOB 0 Entries
Result: 0 Entries
ORDER_CCARD 1 Entry
Result: 1 Entry
ORDER_CCARD_EX 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX 0 Entries
Result: 2 Entries
ORDER_CONDITION_EX 0 Entries
Result: 0 Entries
ORDER_INCOMPLETE 0 Entries
Result: 0 Entries
MESSAGETABLE 0 Entries
Result: 1 Entry
EXTENSIONIN 0 Entries
Result: 0 Entries
PARTNERADDRESSES 1 Entry
Result: 3 Entries
WMDVSX 0 Entries
Result: 0 Entries
WMDVEX 0 Entries
Result: 0 Entries
Z_AVAIL_OUT 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
Result: 0 Entries
ORDER_ITEMS_IN2 0 Entries
Result: 1 Entry
ORDER_PARTNERS2 0 Entries
Result: 2 Entries
Additional Note :
Checking CONDITIONS EX , for free goods
I am using Function module :Z_BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: Z_BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to simulate free goods .
It is only not giving ORDER_CONDITION_EX for free goods materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
I know my data for input are correct as I can make a sale order with the same data.AMit ,
as per my knowledge , this message is coming from SPRO
<b>T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
Please help me with : What is the reason for this message? I am able to make a sale order with the same data</b>
<b>1.First try in Va01 with the same Data then check ? If u get the same message then problem with ur input data</b>
regards
Prabhu -
Hi Gurus,
I am using a BAPI : Z_BAPI_SALESORDER_SIMULATE , this Bapi is similar to the BAPI_SALESORDER_SIMULATE . It has customizations that are similar to the customizations done for order in the SAP system at my organization.
In the Output in the MESSAGETABLE I get the message
T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
Please help me with : What is the reason for this message? I am able to make a sale order with the same data
I am using exactly the same data in VA01 to create a sale order as I am using to test this BAPI: Z_BAPI_SALESORDER_SIMULATE
Please help me at the earliest to solve this problem
BAPI INPUT :
ORDER_HEADER_IN OR
CONVERT_PARVW_AUART
Tables Value
ORDER_ITEMS_IN 1 Entry
ORDER_PARTNERS 2 Entries
ORDER_SCHEDULE_IN 1 Entry
ORDER_CONDITIONS_IN 0 Entries
ORDER_ITEMS_OUT 0 Entries
ORDER_CFGS_REF 0 Entries
ORDER_CFGS_INST 0 Entries
ORDER_CFGS_PART_OF 0 Entries
ORDER_CFGS_VALUE 0 Entries
ORDER_CFGS_BLOB 0 Entries
ORDER_CCARD 1 Entry
ORDER_CCARD_EX 0 Entries
ORDER_SCHEDULE_EX 0 Entries
ORDER_CONDITION_EX 0 Entries
ORDER_INCOMPLETE 0 Entries
MESSAGETABLE 0 Entries
EXTENSIONIN 0 Entries
PARTNERADDRESSES 1 Entry
WMDVSX 0 Entries
WMDVEX 0 Entries
Z_AVAIL_OUT 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
ORDER_ITEMS_IN2 0 Entries
ORDER_PARTNERS2 0 Entries
BAPI Output is :
Import parameters Value
ORDER_HEADER_IN OR I have this filled in
CONVERT_PARVW_AUART
DELAY 0
Export parameters Value
SALESDOCUMENT
ORDER_HEADER_EX OR
SOLD_TO_PARTY
SHIP_TO_PARTY
BILLING_PARTY
RETURN
ORDER_HEADER OR SO500750 00/00/0000 00/00/0000
Tables Value
ORDER_ITEMS_IN 1 Entry
Result: 1 Entry
ORDER_PARTNERS 2 Entries
Result: 2 Entries
ORDER_SCHEDULE_IN 1 Entry
Result: 1 Entry
ORDER_CONDITIONS_IN 0 Entries
Result: 0 Entries
ORDER_ITEMS_OUT 0 Entries
Result: 2 Entries
ORDER_CFGS_REF 0 Entries
Result: 0 Entries
ORDER_CFGS_INST 0 Entries
Result: 0 Entries
ORDER_CFGS_PART_OF 0 Entries
Result: 0 Entries
ORDER_CFGS_VALUE 0 Entries
Result: 0 Entries
ORDER_CFGS_BLOB 0 Entries
Result: 0 Entries
ORDER_CCARD 1 Entry
Result: 1 Entry
ORDER_CCARD_EX 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX 0 Entries
Result: 2 Entries
ORDER_CONDITION_EX 0 Entries
Result: 0 Entries
ORDER_INCOMPLETE 0 Entries
Result: 0 Entries
MESSAGETABLE 0 Entries
Result: 1 Entry
EXTENSIONIN 0 Entries
Result: 0 Entries
PARTNERADDRESSES 1 Entry
Result: 3 Entries
WMDVSX 0 Entries
Result: 0 Entries
WMDVEX 0 Entries
Result: 0 Entries
Z_AVAIL_OUT 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
Result: 0 Entries
ORDER_ITEMS_IN2 0 Entries
Result: 1 Entry
ORDER_PARTNERS2 0 Entries
Result: 2 Entries
Additional Note :
Checking CONDITIONS EX , for free goods
I am using Function module :Z_BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: Z_BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to simulate free goods .
It is only not giving ORDER_CONDITION_EX for free goods materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
I know my data for input are correct as I can make a sale order with the same data.hello,
I am using a BAPI: Z_BAPI_SALESORDER_SIMULATE, this Bapi is similar to the BAPI_SALESORDER_SIMULATE. It has customizations that are similar to the customizations done for order in the SAP system at my organization.
Checking CONDITIONS EX , for free goods
I am using Function module :Z_BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: Z_BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to simulate free goods .
It is only not giving ORDER_CONDITION_EX for free goods materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
I<b> know my data for input are correct as I can make a sale order with the same data.
In the Output in the MESSAGETABLE I get the message
T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
Please help me with : What is the reason for this message? I am able to make a sale order with the same data</b>
I am using exactly the same data in VA01 to create a sale order as I am using to test this BAPI: Z_BAPI_SALESORDER_SIMULATE
Please help me at the earliest to solve this problem
BAPI INPUT :
ORDER_HEADER_IN OR
CONVERT_PARVW_AUART
Tables Value
ORDER_ITEMS_IN 1 Entry
ORDER_PARTNERS 2 Entries
ORDER_SCHEDULE_IN 1 Entry
ORDER_CONDITIONS_IN 0 Entries
ORDER_ITEMS_OUT 0 Entries
ORDER_CFGS_REF 0 Entries
ORDER_CFGS_INST 0 Entries
ORDER_CFGS_PART_OF 0 Entries
ORDER_CFGS_VALUE 0 Entries
ORDER_CFGS_BLOB 0 Entries
ORDER_CCARD 1 Entry
ORDER_CCARD_EX 0 Entries
ORDER_SCHEDULE_EX 0 Entries
ORDER_CONDITION_EX 0 Entries
ORDER_INCOMPLETE 0 Entries
MESSAGETABLE 0 Entries
EXTENSIONIN 0 Entries
PARTNERADDRESSES 1 Entry
WMDVSX 0 Entries
WMDVEX 0 Entries
Z_AVAIL_OUT 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
ORDER_ITEMS_IN2 0 Entries
ORDER_PARTNERS2 0 Entries
BAPI Output is :
Import parameters Value
ORDER_HEADER_IN OR I have this filled in
CONVERT_PARVW_AUART
DELAY 0
Export parameters Value
SALESDOCUMENT
ORDER_HEADER_EX OR
SOLD_TO_PARTY
SHIP_TO_PARTY
BILLING_PARTY
RETURN
ORDER_HEADER OR sales area 00/00/0000 00/00/0000
Tables Value
ORDER_ITEMS_IN 1 Entry
Result: 1 Entry
ORDER_PARTNERS 2 Entries
Result: 2 Entries
ORDER_SCHEDULE_IN 1 Entry
Result: 1 Entry
ORDER_CONDITIONS_IN 0 Entries
Result: 0 Entries
ORDER_ITEMS_OUT 0 Entries
Result: 2 Entries
ORDER_CFGS_REF 0 Entries
Result: 0 Entries
ORDER_CFGS_INST 0 Entries
Result: 0 Entries
ORDER_CFGS_PART_OF 0 Entries
Result: 0 Entries
ORDER_CFGS_VALUE 0 Entries
Result: 0 Entries
ORDER_CFGS_BLOB 0 Entries
Result: 0 Entries
ORDER_CCARD 1 Entry
Result: 1 Entry
ORDER_CCARD_EX 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX 0 Entries
Result: 2 Entries
ORDER_CONDITION_EX 0 Entries
Result: 0 Entries
ORDER_INCOMPLETE 0 Entries
Result: 0 Entries
MESSAGETABLE 0 Entries
Result: 1 Entry
EXTENSIONIN 0 Entries
Result: 0 Entries
PARTNERADDRESSES 1 Entry
Result: 3 Entries
WMDVSX 0 Entries
Result: 0 Entries
WMDVEX 0 Entries
Result: 0 Entries
Z_AVAIL_OUT 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
Result: 0 Entries
ORDER_ITEMS_IN2 0 Entries
Result: 1 Entry
ORDER_PARTNERS2 0 Entries
Result: 2 Entries -
Help needed in editing a contract
Hi All,
I am using the BAPI "BAPI_CUSTOMERCONTRACT_CHANGE" to edit the contract.
In tables parameter, we have PARTNERS,PARTNERADDRESSES, CONTRACTKEYS,EXTENSIONIN, CONTRACT_TEXT without checkbox structures. In that case how can we update the corresoonding fields in the structure.
Thanks in advance.
Regards,
Udaya.
All helpful answers will be rewarded.The Child Text parameter is the one you are searching for. It accepts a 1D string array for the following columns.
hope this helps,
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it. -
Hello All,
My requirement - A new field ZLGCYPO - CHAR(10) is added to existing EKKO structure. Now I want to update the field for a given PO using BAPI. Can anyone pls help me in solving this?Hi,
use the BAPI BAPI_PO_CHANGE to update the custom field.
Extend the structure BAPI_TE_MEPOHEADER with the custom field..
Use EXTENSIONIN structure to populate the custom field.
Thanks,
Naren -
Profit Center not getting uploaded through BAPI for MM01. Pls help
Hello all,
I am getting an errror while uploading a file through BAPI for MM01 , The error says
Error:
Profit center 1000/sslcommon does not exist
for material: AC2
*& Report ZBAPI_DUMMY
REPORT ZBAPI_MM01.
*& Report ZBAPI2
TABLES
FLAGS *
DATA: F_STOP. " Flag used to stop processing
DATA DECLARATIONS *
DATA : V_EMPTY TYPE I, " No. of empty records
V_TOTAL TYPE I. " Total no. of records.
STRUCTURES & INTERNAL TABLES
*--- BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2, " Return Parameter
BAPI_MARDL LIKE BAPI_MARD,
BAPI_MARDX LIKE BAPI_MARDX.
*--- Internal table to hold excel file data
DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*--- Internal table to hold Matetrial descriptions
DATA: BEGIN OF IT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 100,
WERKS(4), " Plant
MTART(4), " Material type
MATNR(18), " Material number
MATKL(9) , " Material group
MBRSH(1), " Industry sector
MEINS(3), " Base unit of measure
SPART(2), " Division
EKGRP(3), " Purchasing group
PRCTR(10), " Profit Center
VPRSV(1), " Price control indicator
BKLAS(4), "Valuation Class
*stprs(12), " Standard price
PEINH(3), " Price unit
SPRAS(2), " Language key
MAKTX(40), " Material description
LGORT(4) , " storage location
DISMM(2) , "MRP TYPE
VERPR(23), " Moving Average Price
MTVFP(2) , " Availability Check
DISLS(2) , "Lot Size
DISPO(3) , "MRP Controller
BESKZ(1) , "Procurment Type
FHORI(3) , "SCHEDMARGIN KEY
PERKZ(1) , "Period Indicator
END OF IT_DATA.
SELECTION SCREEN. *
SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY " Input File
PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 2 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK SCR1.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*--- Validating file
PERFORM VALIDATE_FILE USING P_FILE.
START-OF-SELECTION
START-OF-SELECTION.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
IF NOT IT_DATA[] IS INITIAL.
*--- Perform to delete Header lines
PERFORM DELETE_HEADER_EMPTY_RECS.
ENDIF.
END OF SELECTION. *
END-OF-SELECTION.
*--- Perform to upload Material Master data
PERFORM UPLOAD_MATMAS.
Form : validate_input_file
Description : To provide F4 help for file if read from PC
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
ENDIF.
ENDFORM. " validate_input_file
*& Form CONVER_XLS_ITAB
text
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ENDFORM. " CONVERT_XLS_ITAB
*& Form MOVE_DATA
text
FORM MOVE_DATA.
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS <FS> .
*--- Sorting the internal table
SORT IT_INTERN BY ROW COL.
CLEAR IT_INTERN.
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS> .
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO <FS> .
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form DELETE_HEADER_EMPTY_RECS
To delete the Header and empty records
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX.
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
P_HEADER = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
V_EMPTY = V_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES V_TOTAL.
IF V_TOTAL = 0.
MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
F_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*& Form UPLOAD_MATMAS
to upload Material Master data
FORM UPLOAD_MATMAS .
LOOP AT IT_DATA.
Header
BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
BAPI_HEAD-storage_view ='X'.
bapi_head-mrp_view = 'X'.
bapi_head-COST_view ='X'.
Material Description
REFRESH IT_MAKT.
IT_MAKT-LANGU = IT_DATA-SPRAS.
IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
APPEND IT_MAKT.
Client Data - Basic
BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
bapi_mara1-unit_of_wt = it_data-gewei.
BAPI_MARA1-DIVISION = IT_DATA-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
Plant - Purchasing
BAPI_MARC1-PLANT = IT_DATA-WERKS.
BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
BAPI_MARC1-PROFIT_CTR = IT_DATA-PRCTR.
BAPI_MARC1-MRP_TYPE = IT_DATA-DISMM.
BAPI_MARC1-AVAILCHECK = IT_DATA-MTVFP.
BAPI_MARC1-LOTSIZEKEY = IT_DATA-DISLS.
BAPI_MARC1-MRP_CTRLER = IT_DATA-DISPO.
BAPI_MARC1-PROC_TYPE = IT_DATA-BESKZ.
BAPI_MARC1-SM_KEY = IT_DATA-FHORI.
BAPI_MARC1-PERIOD_IND = IT_DATA-PERKZ.
BAPI_MARCX-PLANT = IT_DATA-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
BAPI_MARCX-AVAILCHECK = 'X'.
BAPI_MARCX-PROFIT_CTR = 'X'.
BAPI_MARCX-MRP_TYPE = 'X'.
BAPI_MARCX-MRP_CTRLER = 'X'.
BAPI_MARCX-SM_KEY = 'X'.
BAPI_MARCX-LOTSIZEKEY = 'X'.
Storage Location.
BAPI_MARDL-PLANT = IT_DATA-WERKS.
BAPI_MARDL-STGE_LOC = IT_DATA-LGORT.
BAPI_MARDX-PLANT = IT_DATA-WERKS.
BAPI_MARDX-STGE_LOC = IT_DATA-LGORT.
Accounting
BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
BAPI_MBEW1-VAL_CLASS = IT_DATA-BKLAS.
BAPI_MBEW1-MOVING_PR = IT_DATA-VERPR.
bapi_mbew1-std_price = it_data-stprs.
BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
BAPI_MBEWX-MOVING_PR = 'X'.
*--- BAPI to create material
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA = BAPI_MARDL
STORAGELOCATIONDATAX = BAPI_MARDX
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA = BAPI_MVKE1
SALESDATAX = BAPI_MVKEX
STORAGETYPEDATA =
STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,
IT_DATA-MATNR.
ELSEIF BAPI_RETURN-TYPE = 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN = BAPI_RETURN
WRITE: 'Successfully created material' ,IT_DATA-MATNR.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN = BAPI_RETURN
ENDLOOP.
ENDFORM. " UPLOAD_MATMASthe Profit center 1000/sslcommon not created. first create the profit center and then upload your data.check tcode KE52 for created profit centers...
-
Purchase Order (BAPI_PO_CREATE! -- EXTENSIONIN)
Hi people!!
I want to create purchase order with the BAPI BAPI_PO_CREATE1, but i have to populated some fields of EKKO table that they are´nt in BAPI and i have to used the EXTENSIONIN structure.
Some example?
This Bapi saved this fields with EXTENSIONIN or
do i have to do something more?
Sorry, but my english is very short and very poor,
Thanks and kind regards,...Hi Juan,
To use the extension in structure:
Declare a local structure (say 'mystruct') with the type of the structure that contains the fields you want to add (it may be declared in the dictionary).
Declare another local structure (say 'mystructx') with the same fields name but with types CHAR1 (they are flags).
Fill mystruct with the values you want.
Fill mystructx with 'X' when you want to modify the corresponding fields.
you will have to fill 2 lines in EXTENSIONIN for header, and 2 lines for each item :
<u>First line :</u>
STRUCTURE : the name of the type of mystruct.
VALUEPART1 : the 240 first characters of mystruct
VALUEPART2 : the 240 following characters of mystruct (of blank if mystruct is not long enough)
VALUEPART3 : the 240 following characters of mystruct (of blank if mystruct is not long enough)
VALUEPART4: the 240 following characters of mystruct (of blank if mystruct is not long enough)
<u>Second line :</u>
STRUCTURE : the name of the type of mystructx.
VALUEPART1 : the 240 first characters of mystructx
VALUEPART2 : the 240 following characters of mystructx (of blank if mystruct is not long enough)
VALUEPART3 : the 240 following characters of mystructx (of blank if mystruct is not long enough)
VALUEPART4: the 240 following characters of mystructx (of blank if mystruct is not long enough)
Hope that helps.
Tell if you want examples. -
Help - Error in PR BAPI : Purchasing across company codes is not allowed..
I have written a program to create Purchase Requisition.I am using two BAPIs.In the file i specify the old PR No, New Plant,Purch Group and Purch Org.It is actually a program to create a new PR in a new plant which is a copy of an Old PR in older plant.
Program is below:
I am getting the error Purchasing across company codes is not allowed..
Please Help
*& Report ZMMB_BDC_ME51N_WO
REPORT ZMMB_BDC_ME51N_WO.
INITIALIZATION.
D A T A D E C L A R A T I O N *
TYPES: BEGIN OF TY_TABDATA,
BANFN TYPE EBAN-BANFN, " Purchase Requistion No
WERKS TYPE MEREQ3211GRID-WERKS, "Plant
EKGRP TYPE MEREQ3211GRID-EKGRP, "Purchasing Group
EKORG TYPE MEREQ3211GRID-EKORG, "Purchasing Organization
END OF TY_TABDATA.
TYPES: BEGIN OF TY_CHECK,
BANFN TYPE EBAN-BANFN, " Purchase Requistion No
BNFPO TYPE EBAN-BNFPO, " Purchase Requistion Item No
EBAKZ TYPE EBAN-EBAKZ, " PR Closed
END OF TY_CHECK.
Declaration of the Internal Table & Work Area.
DATA:
IT_TABDATA TYPE STANDARD TABLE OF TY_TABDATA, " Internal Table for file
WA_TABDATA TYPE TY_TABDATA.
DATA: IT_ITEM TYPE STANDARD TABLE OF BAPIEBAN ,
WA_ITEM LIKE LINE OF IT_ITEM,
IT_ITEM1 TYPE STANDARD TABLE OF BAPIEBANC,
WA_ITEM1 LIKE LINE OF IT_ITEM1,
IT_ACCOUNT TYPE STANDARD TABLE OF BAPIEBKN,
WA_ACCOUNT LIKE LINE OF IT_ACCOUNT,
IT_PRITEMTEXT TYPE STANDARD TABLE OF BAPIEBANTX,
WA_PRITEMTEXT LIKE LINE OF IT_PRITEMTEXT,
IT_SERVICES TYPE STANDARD TABLE OF BAPIESLL ,
WA_SERVICES LIKE LINE OF IT_SERVICES,
IT_SERVICES1 TYPE STANDARD TABLE OF BAPIESLLC ,
WA_SERVICES1 LIKE LINE OF IT_SERVICES1,
IT_SERVICETEXT TYPE STANDARD TABLE OF BAPIESLLTX,
WA_SERVICETEXT LIKE LINE OF IT_SERVICETEXT,
IT_CHECK TYPE STANDARD TABLE OF TY_CHECK,
WA_CHECK LIKE LINE OF IT_CHECK.
Global data Declaration
DATA: GV_YEAR(4) TYPE C,
GV_MNTH(2) TYPE C,
GV_DATE(2) TYPE C,
GV_DATUM(8) TYPE C,
GV_ANS TYPE C,
W_FILENAME TYPE STRING.
Declaration of the Internal Table with Header Line comprising of the uploaded data.
DATA: BEGIN OF IT_FILE_UPLOAD OCCURS 0.
INCLUDE STRUCTURE ALSMEX_TABLINE. " Rows for Table with Excel Data
DATA: END OF IT_FILE_UPLOAD.
Batch Input Data for a single Transaction.
Message of Call Transaction.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
MSGTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001,
BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK B2,
END OF BLOCK B1.
E V E N T : AT S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = 'X'
CHANGING
FILE_NAME = P_FNAME.
E V E N T : S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Upload Excel file into Internal Table.
PERFORM UPLOAD_EXCEL_FILE.
IF NOT IT_FILE_UPLOAD IS INITIAL.
Confirm whether you want to proceed with the Upload.
PERFORM CONFIRM_UPLOAD.
IF GV_ANS EQ '1'.
Organize the uploaded data into another Internal Table.
PERFORM ORGANIZE_UPLOADED_DATA.
PERFORM BAPI_CALL.
ENDIF.
ELSE.
LEAVE PROGRAM.
ENDIF.
*& Form UPLOAD_EXCEL_FILE
text
--> p1 text
<-- p2 text
FORM UPLOAD_EXCEL_FILE .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FNAME
I_BEGIN_COL = 1
I_BEGIN_ROW = 4
I_END_COL = 4
I_END_ROW = 9999
TABLES
INTERN = IT_FILE_UPLOAD
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " UPLOAD_EXCEL_FILE
*& Form CONFIRM_UPLOAD
text
--> p1 text
<-- p2 text
FORM CONFIRM_UPLOAD .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = TEXT-002
TEXT_QUESTION = TEXT-003
IMPORTING
ANSWER = GV_ANS
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
ENDFORM. " CONFIRM_UPLOAD
*& Form ORGANIZE_UPLOADED_DATA
text
--> p1 text
<-- p2 text
FORM ORGANIZE_UPLOADED_DATA .
DATA : GV_TOTROW TYPE I, "No of records
GV_ROW TYPE I,
LC_CNT(3) TYPE N.
GV_TOTROW = 1.
SORT IT_FILE_UPLOAD BY ROW
COL.
LOOP AT IT_FILE_UPLOAD.
GV_TOTROW = IT_FILE_UPLOAD-ROW.
ENDLOOP.
GV_ROW = 1.
WHILE GV_ROW <= GV_TOTROW.
LOOP AT IT_FILE_UPLOAD WHERE ROW = GV_ROW.
CASE IT_FILE_UPLOAD-COL.
WHEN '0001'.
WA_TABDATA-BANFN = IT_FILE_UPLOAD-VALUE.
WHEN '0002'.
WA_TABDATA-WERKS = IT_FILE_UPLOAD-VALUE.
WHEN '0003'.
WA_TABDATA-EKGRP = IT_FILE_UPLOAD-VALUE.
WHEN '0004'.
WA_TABDATA-EKORG = IT_FILE_UPLOAD-VALUE.
ENDCASE.
ENDLOOP.
GV_ROW = GV_ROW + 1.
APPEND WA_TABDATA TO IT_TABDATA .
CLEAR :WA_TABDATA.
ENDWHILE.
ENDFORM. " ORGANIZE_UPLOADED_DATA
*& Form BAPI_CALL
text
--> p1 text
<-- p2 text
FORM BAPI_CALL .
DATA:ITM_NO(4) TYPE N,LV_PERCENTAGE(3) TYPE N,
LV_MSG(60),
IT_RETURN TYPE STANDARD TABLE OF BAPIRETURN,
WA_RETURN LIKE LINE OF IT_RETURN.
DATA: BEGIN OF WA_RETURN1,
BANFN TYPE EBAN-BANFN.
INCLUDE TYPE BAPIRETURN.
DATA END OF WA_RETURN1.
DATA:IT_RETURN1 LIKE STANDARD TABLE OF WA_RETURN1.
DESCRIBE TABLE IT_TABDATA LINES ITM_NO.
LOOP AT IT_TABDATA INTO WA_TABDATA.
CALL FUNCTION 'BAPI_REQUISITION_GETDETAIL'
EXPORTING
NUMBER = WA_TABDATA-BANFN
ACCOUNT_ASSIGNMENT = 'X'
ITEM_TEXTS = 'X'
SERVICES = 'X'
SERVICE_TEXTS = 'X'
TABLES
REQUISITION_ITEMS = IT_ITEM
REQUISITION_ACCOUNT_ASSIGNMENT = IT_ACCOUNT
REQUISITION_TEXT = IT_PRITEMTEXT
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES = IT_SERVICES
REQUISITION_SERVICES_TEXTS = IT_SERVICETEXT
REQUISITION_SRV_ACCASS_VALUES =
RETURN =
COMPUTE LV_PERCENTAGE = ( ITM_NO / SY-TABIX ) * 100.
CONCATENATE 'PROCESSING PURCHASING REQUISITION FOR OLD PR NUMBER ' WA_TABDATA-BANFN INTO LV_MSG.
CALL FUNCTION 'RM_SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = LV_PERCENTAGE
TEXT = LV_MSG.
CLEAR:LV_PERCENTAGE ,LV_MSG.
IF IT_TABDATA[] IS NOT INITIAL.
SELECT BANFN BNFPO EBAKZ FROM EBAN INTO TABLE IT_CHECK FOR ALL ENTRIES IN IT_TABDATA
WHERE BANFN = IT_TABDATA-BANFN AND EBAKZ = 'X'.
ENDIF.
LOOP AT IT_CHECK INTO WA_CHECK.
LOOP AT IT_ITEM INTO WA_ITEM WHERE PREQ_NO = WA_CHECK-BANFN AND PREQ_ITEM = WA_CHECK-BNFPO.
DELETE IT_ITEM WHERE PREQ_NO = WA_CHECK-BANFN AND PREQ_ITEM = WA_CHECK-BNFPO.
ENDLOOP.
LOOP AT IT_ACCOUNT INTO WA_ACCOUNT WHERE PREQ_NO = WA_CHECK-BANFN AND PREQ_ITEM = WA_CHECK-BNFPO.
DELETE IT_ACCOUNT WHERE PREQ_NO = WA_CHECK-BANFN AND PREQ_ITEM = WA_CHECK-BNFPO.
ENDLOOP.
ENDLOOP.
LOOP AT IT_ITEM INTO WA_ITEM.
WA_ITEM-PLANT = WA_TABDATA-WERKS.
WA_ITEM-PUR_GROUP = WA_TABDATA-EKGRP.
WA_ITEM-PURCH_ORG = WA_TABDATA-EKORG.
MODIFY IT_ITEM FROM WA_ITEM TRANSPORTING PLANT PUR_GROUP PURCH_ORG.
MOVE-CORRESPONDING WA_ITEM TO WA_ITEM1.
WA_ITEM1-PREQ_NO = ''.
WA_ITEM1-STORE_LOC = ''.
APPEND WA_ITEM1 TO IT_ITEM1.
CLEAR WA_ITEM1.
ENDLOOP.
LOOP AT IT_ACCOUNT INTO WA_ACCOUNT.
WA_ACCOUNT-PREQ_NO = ''.
MODIFY IT_ACCOUNT FROM WA_ACCOUNT TRANSPORTING PREQ_NO.
ENDLOOP.
LOOP AT IT_SERVICES INTO WA_SERVICES.
MOVE-CORRESPONDING WA_SERVICES TO WA_SERVICES1.
APPEND WA_SERVICES1 TO IT_SERVICES1.
CLEAR WA_SERVICES1.
ENDLOOP.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
EXPORTING
SKIP_ITEMS_WITH_ERROR =
AUTOMATIC_SOURCE = 'X'
IMPORTING
NUMBER =
TABLES
REQUISITION_ITEMS = IT_ITEM1
REQUISITION_ACCOUNT_ASSIGNMENT = IT_ACCOUNT
REQUISITION_ITEM_TEXT = IT_PRITEMTEXT
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES = IT_SERVICES1
REQUISITION_SRV_ACCASS_VALUES =
RETURN = IT_RETURN
REQUISITION_SERVICES_TEXT = IT_SERVICETEXT
REQUISITION_ADDRDELIVERY =
EXTENSIONIN =
READ TABLE IT_RETURN INTO WA_RETURN INDEX 1.
IF WA_RETURN-TYPE = 'E'.
CLEAR WA_RETURN.
LOOP AT IT_RETURN INTO WA_RETURN WHERE TYPE EQ 'E'.
WA_RETURN1-BANFN = WA_TABDATA-BANFN.
MOVE-CORRESPONDING WA_RETURN TO WA_RETURN1.
APPEND WA_RETURN1 TO IT_RETURN1.
CLEAR WA_RETURN1.
ENDLOOP.
ELSE.
WA_RETURN1-BANFN = WA_TABDATA-BANFN.
MOVE-CORRESPONDING WA_RETURN TO WA_RETURN1.
APPEND WA_RETURN1 TO IT_RETURN1.
CLEAR WA_RETURN1.
ENDIF.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
REFRESH: IT_RETURN[],IT_ITEM[],IT_ACCOUNT[],IT_PRITEMTEXT[],IT_ITEM1[],IT_SERVICES[],IT_SERVICES1[],
IT_SERVICETEXT[].
ENDLOOP.
WRITE :10 'OLD PR NUMBER' COLOR COL_KEY, 25 'MESSAGE' COLOR COL_KEY.
LOOP AT IT_RETURN1 INTO WA_RETURN1.
WRITE:/10 WA_RETURN1-BANFN,25 WA_RETURN1-MESSAGE.
ENDLOOP.
CLEAR:IT_TABDATA[],WA_TABDATA.
ENDFORM . "BAPI_CALLSolved on Own
-
Extensionin populated, however doesn't work
Hi everyone,
I'm using SHP_OBDLV_SPLIT_DECENTRAL FM to split outbound delivery (inbound process). It works fine. It comes into SAP with already populated EXTENSIONIN segment (which can be populated the way we want). Currently I have as below:
STRUCTURE BAPI_TE_LIKP
VALUEPART1 8000020134ITISTESTOFROUTINE
And structure BAPI_TE_LIKP
VBELN VBELN_VL CHAR 10 0 Delivery
.APPEND APPDLIKP 0 0 Append for BAPI_TE_LIKP
LIFEX LIFEX CHAR 35 0 External Identification of Delivery Note
Is there anything wrong with above as it doesn't update field LIFEX of new delivery. Do I have to include MANDT field , do I have to tick Key check box or append another EXTENSIONIN segment with structure BAPI_TE_LIKPX ?
Thanks and regards,
DVAtreides wrote:
} catch (Exception e9) {
}Anything anyone can think of that could be goign wrong here? Any help would be very appreciated!,
AtreidesNever ever silently catch execptions. Insert
e9.printStackTrace(System.err);into your catch block. Then at least you'll know what the problem is. -
Urgent: Bapi_po_change Extensionin Parameter...
Hi ,
I want to update a Zfield created in Database using BAPI_PO_CHANGE.
It would be more helpfull. IF any one can give a sample code for that ...
i have done the coding but the field is not getting updated ..
It will helpfull..if i can get the steps and any additional things to be done ....
i have used Extensionin parameter....Hi Gokul,
Check the following link on Bapi_po_change, It's a sample program.
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
reward points if helpful. -
EXTENSIONIN PARAMETER IN BAPI_RESERVATION_CREATE1
Hi Experts,
I need the extension structure name to use when I have custom fields during the creation of a reservation via the BAPI, BAPI_RESERVATION_CREATE1.
The thing is I am creating the reservation from srm, but for my cuf fields to be displayed, I need to pass them through the BAPI extension structure. I have tried all sorts of structures and they do not work.
I need your help guys.
Thabo.
Edited by: Thabo Matsepe on Nov 25, 2008 1:10 PMHi,
In the EXTENSIONIN param Structure should be BAPI_TE_XXXXX(Which has the custom fields) .
If you don't know one in se11 search with BAPI_TE_* , I am sure you will one which has ur fields.
And then in Value part1 should have your data.
For Ex. you want to send company code , asset no.
first4 will be your comp code , Next 12 will ur Asset no .
Please revert back if more help required.
Also Check for similar work
[Thread|https://forums.sdn.sap.com/click.jspa?searchID=19143539&messageID=6381845]
Rhea.
Edited by: rhea on Nov 25, 2008 3:31 PM
Edited by: rhea on Nov 25, 2008 3:31 PM
Maybe you are looking for
-
Changes from iWeb 08 to iWeb 09 - is there a complete list anywhere?
Hi all - I just upgraded from '08 to '09. Before I start mucking around too much, I'm wondering if there is a complete list of the changes out there somewhere. Thanks, roxpat
-
Not showing space before signature
Dear sir, Few problem mention below 1. I'm using outlook 2010 standard . I'm facing problem that at the time reply in one particular mail it is not showing space above signature & not running spellcheck at the time of write mail. I need to pr
-
Whats Item validation org's significance?
Hi I was trying to create a Sales Order and I was not able to find my item from the LOV. I was then told by a friend of mine that the item validation org parameter in OM setup>parameters shld be set to the item validation org. My qns are whts the dif
-
Firefox 4 + Android != Key generation?
Firefox 4 on Android (Useragent string: Mozilla/5.0 (Android; Linux armv7l; rv:2.1.1) Gecko/Firefox/4.0.2pre Fennec/4.0.1) lacks a working keygen magic tag, and seems to be lacking a crypto object. Even testing this object with javascript causes java
-
Devcon.exe error message
Hi, My wan miniport adapters stopped functioning recently (exclamation signs on each of them). I tried uninstalling the broken miniports by right clicking and hitting uninstall but that wouldn't work, but was able to uninstall them through a method f