BDC or BAPI for BAPI for Cross-Plant Configuration
Hi,
I am doing BDC for MM02 for Cross Plant configuration in SHDB recording I can See only 10 line item where i can give confiugaration Details.
I am Unable to record the curser if the chrarcterstics have more than 10 lines
Any inputs Please.
Thanks in advance.
Rasheed
Screen is having only 10 lines but when you update its taking all lines of the data.
Similar Messages
-
The value is not allowed for the field Cross-plant CM
Hello All
When i copy material in refernce to existin gone. I am getting this message
"The value is not allowed for the field Cross-plant CM"
I am not putting any thing in this Basic-view Cross-plant CM, but still getting this message.
Any help will be good...Thanks in advance...Hi,
Please check the check box in front of the field config material is checked?
If so then this material is configurable material
A material that can have different variants.
For example, a car can have different paint, trim, and engines.
Configurable materials have a super bill of material (BOM) that contains all the components for producing every variant of the material. Similarly, they have a super task list that contains all the operations. When a material is configured, only the components and operations needed for a variant are selected.
Please check
BR
Diwakar -
BAPI or FM for Source List (ME01 TCode)
Hello,
I have a requirement to upload master data for Source List which is T-Code ME01. Now, as there is a Table Control in it, we are having trouble using LSMW because when there is more than 1 record for the given Material Plant Combination, it fails to handle the 2nd Record. There is a table Control in the T-Code ME01 in which if we go by the Recording in LSMW, we would have the 2nd Record overwrite the 1st Record when we actually try to upload the Data.
So, is there a BAPI by which we can achieve this requirement? Please let me know.
Thanks and Regards,
Venkata Phani Prasad KonduriHello Manjunath,
I have neither used BDC or BAPI Method to upload SourceList but used the LSMW-IDOC method using;
IDoc Type : SRCLST01
Message Type : SRCLST
Process Code : SRCL
Inbound Posting Program : IDOC_INPUT_SRCLIST
It worked fine for me. Try this out.
Thank You,
Venkata Phani Prasad K -
BAPI or IDOCs for Quality info records
I want to know which BAPI or IDOCs is used to upload the Quality info records data from legacy system to SAP.
Hi Raghu
Below is the BDC program I was used for the same.
Program Name : YX30_UPLOAD_QUALITY_INFO
Author : Rameshwar Yadav *
Date : 2006-11-27 *
Description : The purpose of this program is to upload the *
Quality Info Record for I30 System *
Original Transport Number : I30K903055 *
SYS id: SYS_30_1502_03_41_Upload Quality Info Records *
TDS id: TD_30_1502_03_41_Upload Quality Info Records *
UT ID: UT_30_1502_03_41_Upload Quality Info Records *
======================================================================
Change History *
Date | Change No | Name | Description *
yyyy/mm/dd | AAAYYYYMMDD | xxxxxxxxxxxx | *
REPORT YX30_UPLOAD_QUALITY_INFO MESSAGE-ID yx30_conversions
no standard page heading line-size 255.
include yx30_upload_quality_info_top. "Include for Variable Declaration & Selection Screen
include yx30_upload_quality_info_data. "Include for File read & Authority Check
*& At Selection Screen Output *
AT SELECTION-SCREEN OUTPUT. "PBO
PERFORM fill_parameters.
*& Start Of Selection Event *
start-of-selection.
Perform Authority_check. "Subroutine for authority check
Perform prepare_file. "Subroutine for preparing file
perform file_read. "Subroutine for File read
perform update_qi01. "Subroutine for Uploading data
perform write_error_log1. "Subroutine for writing error log
*& Form write_error_log
text
--> p1 text
<-- p2 text
*& Include YX30_UPLOAD_QUALITY_INFO_TOP
Type Declaration
Types: Begin of type_qtyinf,
matnr type matnr, "Material No
lieferant type char10, "Vendor
werk type werks_d, "Plant
frei_dat type char10, "Frei_Dat
stsma type char8, "Stsma
anwso_01 type char1, "ANWSO(01)
anwso_02 type char1, "ANWSO(02)
anwso_03 type char1, "ANWSO(03)
end of type_qtyinf.
Internal Table Declaration
Data: itab_qtyinf type standard table of type_qtyinf. "Internal table for QTYINF.
Work Area Declaration
Data: wa_qtyinf type type_qtyinf. "Work Area for QTYINF.
Variable Declaration
Data: v_file_qtyinf type string, "Source File Name
v1 type string,
v2 type string,
v3 type string,
v_file_return type string,
v_lin TYPE n.
*Selection Screen Declaration
selection-screen *
SELECTION-SCREEN BEGIN OF BLOCK blk1
WITH FRAME TITLE text-s01.
PARAMETER:
p_sysid(3) TYPE c OBLIGATORY , "Source System
p_bukrs(4) TYPE c OBLIGATORY , "Source CompCode
p_samshr type char30 lower case obligatory default '/sap_upload/' , "Samba Share Drive
p_object TYPE CHAR10 OBLIGATORY default 'MAT' . "Migration Data Object
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN SKIP 3.
PARAMETER:
cb_pfill TYPE c AS CHECKBOX DEFAULT 'X' . "Prefill values?
SELECTION-SCREEN COMMENT /1(79) text-s1a.
SELECTION-SCREEN BEGIN OF BLOCK blk3
WITH FRAME TITLE text-s03.
PARAMETER:
pa_filn1(500) TYPE c LOWER CASE
VISIBLE LENGTH 50 , "Filename AppServer
pa_dlimt TYPE c DEFAULT ';' . "Field Delimter
SELECTION-SCREEN END OF BLOCK blk3.
include bdcrecx1. "Include for the subroutine
*& Include YX30_UPLOAD_QUALITY_INFO_DATA
*& Form file_read
Subroutine for reading the source file into internal table
--> p1 text
<-- p2 text
FORM file_read .
DATA:
single_line TYPE string .
*-- read file, split lines into fields and put data into table
OPEN DATASET v_file_qtyinf FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files
IF sy-subrc EQ 0.
DO.
READ DATASET v_file_qtyinf INTO single_line. "Reading the content of file into line
IF sy-subrc = 0.
IF sy-index > 1. "skip header-line
SPLIT "Split the content of line into work area
single_line
AT ';'
INTO
wa_qtyinf-matnr "Material No
wa_qtyinf-lieferant "Vendor
wa_qtyinf-werk "Plant
wa_qtyinf-frei_dat "Frei Date
wa_qtyinf-stsma "STSMA
wa_qtyinf-anwso_01 "ANWSO_01
wa_qtyinf-anwso_02 "ANWSO_02
wa_qtyinf-anwso_03. "ANWSO_03
APPEND wa_qtyinf TO itab_qtyinf. "Appending Work Area to internal table
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET v_file_qtyinf. "Closing the files
ELSE.
MESSAGE e015 .
ENDIF.
DESCRIBE TABLE itab_qtyinf LINES v_lin.
IF v_lin LT 0.
MESSAGE e016 .
ENDIF.
ENDFORM. " file_read
*& Form fill_parameters
Subroutine for getting the file name
FORM fill_parameters .
IF cb_pfill = 'X'.
Preparing QTYINF File
CONCATENATE p_sysid '_forward' INTO v3.
CONCATENATE p_sysid '_QTYINF_' p_bukrs '.CSV' INTO v2.
CONCATENATE p_samshr v3 '/' p_object '/' v2 INTO pa_filn1.
ENDIF.
ENDFORM. " fill_parameters
*& Form Authority_check
Authority Check
--> p1 text
<-- p2 text
FORM authority_check .
Authority Check For the Migration
AUTHORITY-CHECK OBJECT 'YX30_MIGR'
ID 'SYSTEM' FIELD p_sysid
ID 'BUKRS' FIELD p_bukrs
ID 'YX30_DMOBJ' FIELD p_object
ID 'ACTVT' FIELD '16'.
IF sy-subrc <> 0.
MESSAGE e010 WITH p_sysid p_bukrs p_object.
ENDIF.
ENDFORM. " Authority_check
*& Form prepare_file
text
--> p1 text
<-- p2 text
FORM prepare_file .
CONCATENATE p_sysid '_forward' INTO v3.
CONCATENATE p_sysid '_QTYINF_' p_bukrs '.CSV' INTO v2.
CONCATENATE p_samshr v3 '/' p_object '/' v2 INTO v_file_qtyinf.
CLEAR v3.
CLEAR v2.
Prepare Return File
CONCATENATE p_sysid '_forward' INTO v3.
CONCATENATE p_sysid '_RETRUN_LOG_' p_bukrs '.CSV' INTO v2.
CONCATENATE '/sap_upload/' v3 '/' 'MAT' '/' v2 INTO v_file_return.
ENDFORM. " prepare_file
*& Form update_qi01
text
FORM update_qi01.
PERFORM open_group. "Opening a session
CLEAR wa_qtyinf.
LOOP AT itab_qtyinf INTO wa_qtyinf.
PERFORM bdc_dynpro USING 'SAPMQBAA' '0100'. "Subroutine for mapping data
PERFORM bdc_field USING 'BDC_CURSOR'
'QINF-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'QINF-MATNR'
wa_qtyinf-matnr. "Mapping the material
PERFORM bdc_field USING 'QINF-LIEFERANT'
wa_qtyinf-lieferant. "Mapping the vendor
PERFORM bdc_field USING 'QINF-WERK'
wa_qtyinf-werk. "Mapping the plant
PERFORM bdc_dynpro USING 'SAPMQBAA' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=STAN'.
PERFORM bdc_field USING 'QINF-FREI_DAT'
wa_qtyinf-frei_dat.
PERFORM bdc_field USING 'BDC_CURSOR'
'QINF-STSMA'.
PERFORM bdc_field USING 'QINF-STSMA'
wa_qtyinf-stsma. "Mapping the status
PERFORM bdc_dynpro USING 'SAPLBSVA' '0201'.
PERFORM bdc_field USING 'BDC_CURSOR'
'J_STMAINT-ANWSO(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=OKAY'.
IF wa_qtyinf-anwso_01 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'
wa_qtyinf-anwso_01. "Mapping the anwso(01)
ELSEIF wa_qtyinf-anwso_02 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'
wa_qtyinf-anwso_02. "Mapping the anwso(02)
ELSEIF wa_qtyinf-anwso_03 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'
wa_qtyinf-anwso_03. "Mapping the anwso(03)
ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_02 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'
wa_qtyinf-anwso_01.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'
wa_qtyinf-anwso_02.
ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_03 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'
wa_qtyinf-anwso_01.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'
wa_qtyinf-anwso_03.
ELSEIF wa_qtyinf-anwso_02 = 'X' AND wa_qtyinf-anwso_03 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'
wa_qtyinf-anwso_02.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'
wa_qtyinf-anwso_03.
ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_02 = 'X' AND wa_qtyinf-anwso_03 = 'X'.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'
wa_qtyinf-anwso_01.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'
wa_qtyinf-anwso_02.
PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'
wa_qtyinf-anwso_03.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMQBAA' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'QINF-FREI_DAT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=QMBU'.
PERFORM bdc_field USING 'QINF-FREI_DAT'
wa_qtyinf-frei_dat.
PERFORM bdc_field USING 'QINF-STSMA'
wa_qtyinf-stsma.
PERFORM bdc_transaction USING 'QI01'.
ENDLOOP.
PERFORM close_group. "Closing the session
ENDFORM. "update_qi01
*& Form write_error_log
text
--> p1 text
<-- p2 text
FORM write_error_log1 .
DATA:
single_line TYPE string,
v_msg TYPE string,
v_msg1 TYPE string.
*-- read file, split lines into fields and put data into table
OPEN DATASET v_file_return FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files
IF sy-subrc EQ 0.
CONCATENATE text-020 v_lin INTO v_msg SEPARATED BY space.
CONCATENATE text-021 v_lin INTO v_msg1 SEPARATED BY space.
TRANSFER: v_msg TO v_file_return.
TRANSFER: v_msg1 TO v_file_return.
WRITE:/ v_msg.
WRITE:/ v_msg1.
ENDIF.
ENDFORM. " write_error_log
Regards,
Sree -
Step by step procedure with scren shot for BAPI?
Hi,
could u tell me the senario for bapi in real time ?
how to do in realtime ?
any body tellme the step by step procedure with screen shot pls could u help?
i will be waiting for reply.
rehards
eswarHi
what is BAPI?
BAPI stands for Business API(Application Program Interface).
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
The following standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
just refer to the link below
http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
Also refer to the following links..
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
Example Code
U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
U can find these parameters for a particular condition type in table KONV.
*& Form saveTransactionJOCR
text
--> p1 text
<-- p2 text
FORM saveTransactionJOCR .
data: salesdocument like BAPIVBELN-VBELN,
order_header_inx like bapisdh1x,
order_header_in like bapisdh1,
return type standard table of bapiret2 with header line,
conditions_in type standard table of bapicond with header line,
conditions_inx type standard table of bapicondx with header line,
logic_switch like BAPISDLS,
step_nr like conditions_in-cond_st_no,
item_nr like conditions_in-itm_number,
cond_count like conditions_in-cond_count,
cond_type like conditions_in-cond_type.
salesdocument = wa_order_information-VBELN.
LOGIC_SWITCH-COND_HANDL = 'X'.
order_header_inx-updateflag = 'U'.
conditions
clear conditions_in[].
clear conditions_inx[].
clear: step_nr,
item_nr,
cond_count,
cond_type.
step_nr = '710'.
item_nr = '000000'.
cond_count = '01'.
cond_type = 'ZCP2'.
CONDITIONS_IN-ITM_NUMBER = item_nr.
conditions_in-cond_st_no = step_nr.
CONDITIONS_IN-COND_COUNT = cond_count.
CONDITIONS_IN-COND_TYPE = cond_type.
CONDITIONS_IN-COND_VALUE = 666.
CONDITIONS_IN-CURRENCY = 'EUR'.
append conditions_in.
CONDITIONS_INX-ITM_NUMBER = item_nr.
conditions_inx-cond_st_no = step_nr.
CONDITIONS_INX-COND_COUNT = cond_count.
CONDITIONS_INX-COND_TYPE = cond_type.
CONDITIONS_INX-UPDATEFLAG = 'U'.
CONDITIONS_INX-COND_VALUE = 'X'.
CONDITIONS_INX-CURRENCY = 'X'.
append conditions_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = salesdocument
ORDER_HEADER_IN = order_header_in
ORDER_HEADER_INX = order_header_inx
LOGIC_SWITCH = logic_switch
TABLES
RETURN = return
CONDITIONS_IN = conditions_in
CONDITIONS_INX = conditions_inx
if return-type ne 'E'.
commit work and wait.
endif.
ENDFORM. " saveTransactionJOCR
Bdc to Bapi
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
Bapi to VB(Visual Basic)
Long back I had used the following flow structure to acheive the same.
Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
You need to have com4abap.exe
If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
else refer OSS note 419822 for installation of com4abap
after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
for setting up com4abap and rfc destination please refer to the documentation for com4abap.
Invoke NEW DCOM session
call function 'BEGIN_COM_SESSION'
exporting
service_dest = service_dest "(this will be a RFC destination created in SM59)
importing
worker_dest = worker_dest
exceptions
connect_to_dcom_service_failed = 1
connect_to_dcom_worker_failed = 2
others = 3.
call function 'create_com_instance' destination worker_dest
exporting
clsid = g_c_clsid
typelib = g_c_typelib
importing
instid = g_f_oid
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
call function 'com_invoke' destination worker_dest
exporting
%instid = g_f_oid
%method = 'UpdatePDF'
sntemp = g_v_const_filent
snsysid = sy-sysid
snflag = 'N'
tables
rssaptable = g_t_pdfdetail1
%return = g_t_pdfdetail1 "t_test
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
then close the com session , using
FM delete_com_instance
FM END_COM_SESSION
see the sample code
REPORT zpo_bapi_purchord_tej.
DATA DECLARATIONS *
TYPE-POOLS slis.
TYPES: BEGIN OF ty_table,
v_legacy(8),
vendor TYPE bapimepoheader-vendor,
purch_org TYPE bapimepoheader-purch_org,
pur_group TYPE bapimepoheader-pur_group,
material TYPE bapimepoitem-material,
quantity(13),
delivery_date TYPE bapimeposchedule-delivery_date,
net_price(23),
plant TYPE bapimepoitem-plant,
END OF ty_table.
TYPES: BEGIN OF ty_alv,
v_legs(8),
success(10),
v_legf(8),
END OF ty_alv.
TYPES: BEGIN OF ty_alv1,
v_legf1(8),
v_msg(500),
END OF ty_alv1.
*-----Work area declarations.
DATA: x_table TYPE ty_table,
x_header TYPE bapimepoheader,
x_headerx TYPE bapimepoheaderx,
x_item TYPE bapimepoitem,
x_itemx TYPE bapimepoitemx,
x_sched TYPE bapimeposchedule,
x_schedx TYPE bapimeposchedulx,
x_commatable(255),
x_alv TYPE ty_alv,
x_alv1 TYPE ty_alv1,
x_alv2 TYPE ty_alv1.
*-----Internal table declarations.
DATA: it_table TYPE TABLE OF ty_table,
it_commatable LIKE TABLE OF x_commatable,
it_item TYPE TABLE OF bapimepoitem,
it_itemx TYPE TABLE OF bapimepoitemx,
it_sched TYPE TABLE OF bapimeposchedule,
it_schedx TYPE TABLE OF bapimeposchedulx,
it_alv TYPE TABLE OF ty_alv,
it_alv1 TYPE TABLE OF ty_alv1,
it_alv2 TYPE TABLE OF ty_alv1.
DATA: po_number TYPE bapimepoheader-po_number,
x_return TYPE bapiret2,
it_return TYPE TABLE OF bapiret2,
v_file TYPE string,
v_temp(8),
v_succsount TYPE i VALUE 0,
v_failcount TYPE i VALUE 0,
v_total TYPE i.
DATA: v_temp1(5) TYPE n VALUE 0.
DATA: x_event TYPE slis_t_event,
x_fieldcat TYPE slis_t_fieldcat_alv,
x_list_header TYPE slis_t_listheader,
x_event1 LIKE LINE OF x_event,
x_layout1 TYPE slis_layout_alv,
x_variant1 TYPE disvariant,
x_repid2 LIKE sy-repid.
DATA : it_fieldcat TYPE TABLE OF slis_t_fieldcat_alv.
SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK v_b1 WITH FRAME.
*-----To fetch the flat file.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK v_b1.
AT SELECTION-SCREEN *
AT SELECTION-SCREEN.
IF p_file IS INITIAL.
MESSAGE text-001 TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*-----To use F4 help to find file path.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
v_file = p_file.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM gui_upload.
LOOP AT it_table INTO x_table.
PERFORM header_details.
v_temp = x_table-v_legacy.
LOOP AT it_table INTO x_table WHERE v_legacy = v_temp.
PERFORM lineitem.
PERFORM schedule.
ENDLOOP.
DELETE it_table WHERE v_legacy = v_temp.
PERFORM bapicall.
MOVE po_number TO x_alv-success.
APPEND x_alv TO it_alv.
CLEAR x_alv.
*-----To clear the item details in internal table after the operation for a header.
REFRESH: it_item,
it_itemx,
it_sched,
it_schedx.
CLEAR: v_temp1.
ENDLOOP.
v_total = v_succsount + v_failcount.
PERFORM display_alv.
FORM GUI_UPLOAD *
FORM gui_upload .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
TABLES
data_tab = it_commatable
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.
*-----To fetch the comma seperated flat file into an internal table.
LOOP AT it_commatable INTO x_commatable.
IF x_commatable IS NOT INITIAL.
SPLIT x_commatable AT ',' INTO
x_table-v_legacy
x_table-vendor
x_table-purch_org
x_table-pur_group
x_table-material
x_table-quantity
x_table-delivery_date
x_table-net_price
x_table-plant.
APPEND x_table TO it_table.
ENDIF.
CLEAR x_table.
ENDLOOP.
ENDIF.
ENDFORM. " gui_upload
FORM HEADER_DETAILS *
FORM header_details .
MOVE 'NB' TO x_header-doc_type.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_table-vendor
IMPORTING
output = x_table-vendor
MOVE x_table-vendor TO x_header-vendor.
MOVE x_table-purch_org TO x_header-purch_org.
MOVE x_table-pur_group TO x_header-pur_group.
x_headerx-doc_type = 'X'.
x_headerx-vendor = 'X'.
x_headerx-purch_org = 'X'.
x_headerx-pur_group = 'X'.
ENDFORM. " header_details
FORM LINEITEM *
FORM lineitem .
v_temp1 = v_temp1 + 10.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_temp1
IMPORTING
output = v_temp1.
MOVE v_temp1 TO x_item-po_item.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_table-material
IMPORTING
output = x_table-material.
MOVE x_table-material TO x_item-material.
MOVE x_table-quantity TO x_item-quantity.
MOVE x_table-net_price TO x_item-net_price.
MOVE x_table-plant TO x_item-plant.
x_itemx-po_item = v_temp1.
x_itemx-material = 'X'.
x_itemx-quantity = 'X'.
x_itemx-net_price = 'X'.
x_itemx-plant = 'X'.
APPEND x_item TO it_item.
APPEND x_itemx TO it_itemx.
CLEAR: x_item, x_itemx.
ENDFORM. " lineitem1
FORM SCHEDULE *
FORM schedule .
MOVE x_table-delivery_date TO x_sched-delivery_date.
MOVE v_temp1 TO x_sched-po_item.
x_schedx-delivery_date = 'X'.
x_schedx-po_item = v_temp1.
APPEND x_sched TO it_sched.
APPEND x_schedx TO it_schedx.
CLEAR: x_sched, x_schedx.
ENDFORM. " schedule
FORM BAPICALL *
FORM bapicall .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = x_header
poheaderx = x_headerx
IMPORTING
exppurchaseorder = po_number
TABLES
return = it_return
poitem = it_item
poitemx = it_itemx
poschedule = it_sched
poschedulex = it_schedx.
IF po_number IS NOT INITIAL.
v_succsount = v_succsount + 1.
MOVE x_table-v_legacy TO x_alv-v_legs.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
v_failcount = v_failcount + 1.
MOVE x_table-v_legacy TO x_alv-v_legf.
MOVE x_table-v_legacy TO x_alv1-v_legf1.
LOOP AT it_return INTO x_return.
IF x_alv1-v_msg IS INITIAL.
MOVE x_return-message TO x_alv1-v_msg.
ELSE.
CONCATENATE x_alv1-v_msg x_return-message INTO x_alv1-v_msg SEPARATED BY space.
ENDIF.
ENDLOOP.
APPEND x_alv1 TO it_alv1.
CLEAR x_alv1.
ENDIF.
ENDFORM. " bapicall
FORM DISPLAY_ALV *
FORM display_alv .
PERFORM x_list_header.
PERFORM build_fieldcat CHANGING x_fieldcat.
x_repid2 = sy-repid.
x_event1-name = 'TOP_OF_PAGE'.
x_event1-form = 'TOP_OF_PAGE'.
APPEND x_event1 TO x_event.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = x_repid2
is_layout = x_layout1
it_fieldcat = x_fieldcat
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_save = 'A'
is_variant = x_variant1
it_events = x_event
TABLES
t_outtab = it_alv
EXCEPTIONS
program_error = 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.
ENDFORM. " display_master_data
FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm selfield
TYPE slis_selfield.
READ TABLE it_alv INTO x_alv INDEX selfield-tabindex.
CLEAR : x_alv2,it_alv2[].
LOOP AT it_alv1 INTO x_alv1 WHERE v_legf1 = x_alv-v_legf.
x_alv2 = x_alv1.
APPEND x_alv2 TO it_alv2 .
ENDLOOP.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv.
DATA : x3_fieldcat LIKE LINE OF it_fieldcat.
CLEAR : x3_fieldcat,it_fieldcat[].
CLEAR x3_fieldcat.
x3_fieldcat-col_pos = '1'.
x3_fieldcat-fieldname = 'V_LEGF1'.
x3_fieldcat-reptext_ddic = text-111.
x3_fieldcat-ref_tabname = 'IT_ALV2'.
APPEND x3_fieldcat TO it_fieldcat.
CLEAR x3_fieldcat.
CLEAR x3_fieldcat.
x3_fieldcat-col_pos = '1'.
x3_fieldcat-fieldname = 'V_MSG'.
x3_fieldcat-reptext_ddic = text-112.
x3_fieldcat-ref_tabname = 'IT_ALV2'.
APPEND x3_fieldcat TO it_fieldcat.
CLEAR x3_fieldcat.
x_layout1-colwidth_optimize = 'X'.
x_layout1-zebra = 'X'.
IF it_alv2[] IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = x_repid2
is_layout = x_layout1
it_fieldcat = it_fieldcat
i_save = 'A'
i_callback_top_of_page = 'TOP'
is_variant = x_variant1
it_events = x_event
TABLES
t_outtab = it_alv2
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDIF.
ENDFORM.
FORM USER_COMMAND *
FORM top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = 'Commentry'.
ENDFORM.
FORM BUILD_FIELDCAT *
FORM build_fieldcat CHANGING et_fieldcat TYPE slis_t_fieldcat_alv.
DATA: x1_fieldcat TYPE slis_fieldcat_alv.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '1'.
x1_fieldcat-fieldname = 'V_LEGS'.
x1_fieldcat-reptext_ddic = text-108.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '2'.
x1_fieldcat-fieldname = 'SUCCESS'.
x1_fieldcat-key = 'X'.
x1_fieldcat-reptext_ddic = text-109.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
x1_fieldcat-col_pos = '3'.
x1_fieldcat-fieldname = 'V_LEGF'.
x1_fieldcat-key = 'X'.
x1_fieldcat-reptext_ddic = text-110.
x1_fieldcat-ref_tabname = 'IT_ALV'.
APPEND x1_fieldcat TO et_fieldcat.
CLEAR x1_fieldcat.
ENDFORM. " build_fieldcat
FORM BUILD_LIST_HEADER *
FORM x_list_header.
DATA: x_list_header1 TYPE slis_listheader.
*-----List Header: type H
CLEAR x_list_header1 .
x_list_header1-typ = 'H'.
x_list_header1-info = text-105.
APPEND x_list_header1 TO x_list_header.
*-----List Key: type S
x_list_header1-typ = 'S'.
x_list_header1-key = text-106.
x_list_header1-info = v_total.
APPEND x_list_header1 TO x_list_header.
*-----List Key: Type S
CLEAR x_list_header1 .
x_list_header1-typ = 'S'.
x_list_header1-key = text-107.
x_list_header1-info = v_succsount.
APPEND x_list_header1 TO x_list_header.
ENDFORM. " build_list_header
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = x_list_header.
ENDFORM. " TOP_OF_PAGE
<b>Reward points for useful Answers</b>
Regards
Anji -
BAPI/Function Module for Vendor Down Payment Clearing(F-54)
My requirement is to clear Vendor Down Payment Document(F-54). One way is to use BDC but I am looking for other options.
Is there any other way(BAPI/FM) possible except BDC recording to achieve above requirement?
Thanks in advance,Hi Nilesh,
I have the same requirement. How did you achieve it?
Regards
Prashant -
How to create a data filter for BAPI used in a Distribution Model ?
I am trying to create IDOC's for a QM inspection plan via message type QPMK in ECC 6.0. When creating the new message type in the Distribution Model, it forced me to use a BAPI (MasterInspectionChar) rather that just the message as I have done in the past. In order to ensure that only IDOC's related to a specific plant and material type get sent out, I was trying to create a filter.
I am able to get into a 'Change Filter' dialog by double clicking 'No data filter set' under the node 'MasterInspectionChar.SaveReplica'. However, an attempt to highlight anything on this dialog and clicking button 'Create filter group' results in msg. 'Select node: Content-dependent parameter filtering'.
Online help led me in a different direction, one thread led me to believe I needed to create a table entry for the filter in table TBD16 via BD81 for later attachment to the BAPI in the Distribution Model. Before this, I created two Z* ALE Object Type records for plant and material type in table TBD11 via BD95 for what I thought would provide a lookup back in BD81 for creation of a new filter record, but these objects are not found. Per the help, I am also unclear as to whether I would need to set up Receiver determination or Parameter filtering, nor where to make this step in the configuration happen?
Can anyone point me back in the correct direction to get a data filter set up for this BAPI within the Distribution Model ?
Thanks - MikeJust to clarify, what I am having trouble with is finding where exactly to plug in the name of the plant to be filtered? If using a message type such as MATMAS in a distribution model, it is very straight forward to navigate down from the 'Data filter active', and assign a value to whatever field you wish to filter via the 'List of Values'. But in this example, message type QPMK required use of the BAPI MasterInspectionChar, and therefore the different method in creating the filter.
I cannot find similar functionality when navigating the BAPI related row, for MasterInspectionChar. The 'Change Filter' dialog popup displays a row for 'Container' and then 3 more rows containing 'BAPI structure...'. Clicking the 'Attribute' checkbox on any of these rows sets 'Data filter active' as a node under the BAPI. Double clicking the 'Data filter active' brings me back into the same dialog, and selecting any row with an attempt at this point to create a filter results in the 'Select node: content-dependent parameter filtering' warning. Is this warning occuring because of missing configuration?
Thanks - Mike -
How to create purchase order using VA01 for BAPI?
how to create purchase order using VA01 for BAPI?
Hi Arun,
Please check this link
Example Program for BAPI_PO_CREATE1
Re: BAPI_PO_CREATE1
Questions in BAPI_PO_CREATE1
Problem with BAPI_PO_CREATE1
*& Report BAPI_PO_CREATE *
REPORT bapi_po_create.
Input File Declaration
TYPES: BEGIN OF ty_input_file,
column1 TYPE char50,
column2 TYPE char50,
column3 TYPE char50,
column4 TYPE char50,
column5 TYPE char50,
column6 TYPE char50,
column7 TYPE char50,
column8 TYPE char50,
column9 TYPE char50,
column10 TYPE char50,
column11 TYPE char50,
column12 TYPE char50,
column13 TYPE char50,
column14 TYPE char50,
column15 TYPE char50,
column16 TYPE char50,
column17 TYPE char50,
column18 TYPE char50,
END OF ty_input_file.
DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
wa_input_file TYPE ty_input_file.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',.,..',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
Read presentation server file
PERFORM f1003_upload_file.
IF NOT i_input_file[] IS INITIAL.
PERFORM split_data.
ENDIF.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
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. " f4_presentation_file
*& Form f1003_upload_file
*& Upload File
FORM f1003_upload_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_input_file
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.
EXIT.
ENDIF.
ENDFORM. " f1003_upload_file
*& Form split_data
Collect data for creating Purchase Order
FORM split_data .
DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
i_services TYPE STANDARD TABLE OF bapiesllc ,
i_srvacc TYPE STANDARD TABLE OF bapiesklc,
i_return TYPE STANDARD TABLE OF bapiret2,
wa_header TYPE bapimepoheader,
wa_headerx TYPE bapimepoheaderx,
wa_poitem TYPE bapimepoitem,
wa_poitemx TYPE bapimepoitemx,
wa_poitem_sch TYPE bapimeposchedule,
wa_poitem_schx TYPE bapimeposchedulx,
wa_acct_*** TYPE bapimepoaccount,
wa_acct_assx TYPE bapimepoaccountx,
wa_services TYPE bapiesllc,
wa_srvacc TYPE bapiesklc,
wa_return TYPE bapiret2,
ws_po TYPE bapimepoheader-po_number.
break gbpra8.
wa_services-pckg_no = 10.
wa_services-line_no = 1.
wa_services-outl_no = '0'.
wa_services-outl_ind = c_x.
wa_services-subpckg_no = 20.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 10.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 01.
wa_srvacc-serial_no = 01.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
LOOP AT i_input_file INTO wa_input_file.
IF wa_input_file-column2 EQ 'HD'.
wa_header-doc_type = wa_input_file-column3.
wa_header-creat_date = sy-datum.
wa_header-created_by = sy-uname.
wa_header-vendor = wa_input_file-column4.
PERFORM conversion_output USING wa_header-vendor
CHANGING wa_header-vendor.
wa_header-comp_code = 'DE03'.
wa_header-purch_org = 'DE03'.
wa_header-pur_group = 'DE1'.
wa_header-vper_start = wa_input_file-column9.
wa_header-vper_end = wa_input_file-column10.
wa_headerx-comp_code = c_x.
wa_headerx-doc_type = c_x.
wa_headerx-creat_date = c_x.
wa_headerx-created_by = c_x.
wa_headerx-vendor = c_x.
wa_headerx-purch_org = c_x.
wa_headerx-pur_group = c_x.
wa_headerx-vper_start = c_x.
wa_headerx-vper_end = c_x.
ENDIF.
IF wa_input_file-column2 EQ 'IT'.
wa_poitem-po_item = wa_input_file-column3.
wa_poitem-short_text = wa_input_file-column6.
wa_poitem-plant = wa_input_file-column8.
wa_poitem-quantity = '1'.
wa_poitem-tax_code = 'V0'.
wa_poitem-item_cat = 'D'.
wa_poitem-acctasscat = 'K'.
wa_poitem-matl_group = wa_input_file-column7.
wa_poitem-pckg_no = '10'.
APPEND wa_poitem TO i_poitem .
wa_poitemx-po_item = wa_input_file-column3.
wa_poitemx-po_itemx = c_x.
wa_poitemx-short_text = c_x.
wa_poitemx-plant = c_x.
wa_poitemx-quantity = c_x.
wa_poitemx-tax_code = c_x.
wa_poitemx-item_cat = c_x.
wa_poitemx-acctasscat = c_x.
wa_poitemx-matl_group = c_x.
wa_poitemx-pckg_no = c_x.
APPEND wa_poitemx TO i_poitemx.
wa_poitem_sch-po_item = wa_input_file-column3.
wa_poitem_sch-delivery_date = sy-datum.
APPEND wa_poitem_sch TO i_poitem_sch.
wa_poitem_schx-po_item = wa_input_file-column3.
wa_poitem_schx-po_itemx = c_x.
wa_poitem_schx-delivery_date = c_x.
APPEND wa_poitem_schx TO i_poitem_schx.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 01.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 02.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 01.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 02.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_services-pckg_no = 20.
wa_services-line_no = 2.
wa_services-service = wa_input_file-column9.
wa_services-quantity = '100'.
wa_services-gr_price = '100'.
wa_services-userf1_txt = wa_input_file-column13.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 20.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 02.
wa_srvacc-serial_no = 02.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_header
poheaderx = wa_headerx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
exppurchaseorder = ws_po
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = i_return
poitem = i_poitem
poitemx = i_poitemx
POADDRDELIVERY =
poschedule = i_poitem_sch
poschedulex = i_poitem_schx
poaccount = i_acct_***
POACCOUNTPROFITSEGMENT =
poaccountx = i_acct_assx
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
poservices = i_services
posrvaccessvalues = i_srvacc
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
break gbpra8.
LOOP AT i_return INTO wa_return.
ENDLOOP.
ENDFORM. " split_data
*& Form conversion_output
Conversion exit input
FORM conversion_output USING p_ip
CHANGING p_op.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_ip
IMPORTING
output = p_op.
ENDFORM. " conversion_output
Best regards,
raam -
BAPI or FM for Customer Edit XD02
Hi gurus,
Does anyone know if there is a BAPI or FM for updating customer master data (XD02) without resorting to BDC/LSMW processing ?.
I have tried BAPI_CUSTOMER_CHANGEFROMDATA1 but it seems nobody knows which are the mandatory fields.
I have read a lot of threads that mention two more options :
FM SD_CUSTOMER_MAINTAIN_ALL - is it valid to use ? if so, can you share with me some code example plelase...
CMD_EI_API - can you share with me some code example plelase...
Thanks a lot.
IsaacHi Isaac,
Isaac Huerta Segovia wrote:
FM SD_CUSTOMER_MAINTAIN_ALL - is it valid to use ? if so, can you share with me some code example plelase...
Refer Zsuzsanna Hartyani comments on the same in thread
Isaac Huerta Segovia wrote:
CMD_EI_API - can you share with me some code example plelase...
Refer Daniel Klein code example in thread -
Error while creating WebService for BAPI
Hi,
I am trying to create a webservice for BAPI, i created Virtual interface and Webserice and activated.
In transaction code WSCONFIG i checked webservice has been released. When i test webservice i am getting following error in browser.
- <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
- <soap-env:Body>
- <soap-env:Fault>
<faultcode>soap-env:Server</faultcode>
<faultstring xml:lang="en">SOAP processing failure, error id = 112</faultstring>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
Could u please tell me whats wrong on this?
thanks for ur time.
Murali.Does tht mean i need to add the following code
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
For second item.
Line item number.
item-itm_number = '000020'.
itemx-itm_number = 'X'.
Material
item-material = '600020001'.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule lines
lt_schedules_in-itm_number = '000020'.
lt_schedules_in-sched_line = '0002'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Fill schedule line flags
lt_schedules_inx-itm_number = '000020'.
lt_schedules_inx-sched_line = '0002'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
But i guess it is overwritting my frst material..
Also i m gettin a error
For object rv_beleg, number range interval doesnot exist
Pls suggest -
Hi,
Can any one suggest me, how to handle the errors for the BAPI MB_COUNT_POST_WITHOUT_INV_DOC, because this bapi does not have any return table for errors handling? And also suggest any other BAPI which fits for MI10 transaction.
<removed by moderator>
Thanks&Regards,
Damuan.
Edited by: Thomas Zloch on Feb 2, 2012Hi Dear,
Your answer is very helpful, thanks..!!
But when i am testing with the EIKPF structure, neither error is populating in EIKPF nor the records are posting in MI10. Could you please guess what would be the problem?
Below are the fields that i am passing through this BAPI
1)Document date 2)count date 3)plant 4)storage location 5)item number 6)material code 7) entry quantity
Thanks&Regards,
Damuan. -
BAPI Function Module for SCM APO Tcode /SAPAPO/AC42
Hi,
I want to know the BAPI Function Modules for SCM APO Tcode /SAPAPO/AC42.
This BAPI FM should return the column values "Remaining Prod Alloc" and "Incoming Order Quantity" when we give
below details as inputs for the Tcode /SAPAPO/AC42
Product Allocation Group
Product
Allocation Procedure
prod Alloc step
Product Alloc Object (Characteristics of Product Alloc Group)
Plant (Characteristics of Product Alloc Group)
Customer Group 5 (Characteristics of Product Alloc Group)
Reward points if helpful.
Thanks,
MichHi,
You should be able to get the information using the standard BAPI (Assuming you are using SCM5.0) BAPI_APOPAL_INSERT in the transaction BAPI.
ProductAllocationAPO.DataInsert
Interface to Import Product Allocation Data Functionality
This method is used to adopt data from OLTP systems for product allocation in the global availability check.
You can do the following using the method:
Adopt new data
You can adopt new characteristics combinations or new time series. Newly created characteristics combinations have the status Active and are therefore included in the product allocation check.
Change existing data
You can overwrite existing data if you have set the interface parameter ALLOW_UPDATE. You can set the status of existing characteristics combinations to Active if you set the interface parameter UPDATE_STATUS. If the characteristics combination does not exist, the system creates it.
The product allocation quantity is overwritten for existing time series. If you also want to change the incoming orders quantity, you must set the interface parameter UPDATE_INCOMING_ORDER_QTY. If the time series does not exist, the system creates it.
Prerequisite
To be able to use this method, you must have made all the Customizing settings for product allocation. For more information, see the Implementation Guide (IMG) for SAP APO under Global Available-to-Promise -> Product Allocation.
Regards
Vinod -
BAPI Function Module for SCM APO Trans code /SAPAPO/AC42
Hi,
Is there any BAPI Function Modules for SCM APO Tcode /SAPAPO/AC42.
This BAPI FM should return the column values "Remaining Prod Alloc" and "Incoming Order Quantity" when we give
below details as inputs for the Tcode /SAPAPO/AC42
Product Allocation Group
Product
Allocation Procedure
prod Alloc step
Product Alloc Object (Characteristics of Product Alloc Group)
Plant (Characteristics of Product Alloc Group)
Customer Group 5 (Characteristics of Product Alloc Group)
Reward points if helpful.
Thanks,
MichHi,
You should be able to get the information using the standard BAPI (Assuming you are using SCM5.0) BAPI_APOPAL_INSERT in the transaction BAPI.
ProductAllocationAPO.DataInsert
Interface to Import Product Allocation Data Functionality
This method is used to adopt data from OLTP systems for product allocation in the global availability check.
You can do the following using the method:
Adopt new data
You can adopt new characteristics combinations or new time series. Newly created characteristics combinations have the status Active and are therefore included in the product allocation check.
Change existing data
You can overwrite existing data if you have set the interface parameter ALLOW_UPDATE. You can set the status of existing characteristics combinations to Active if you set the interface parameter UPDATE_STATUS. If the characteristics combination does not exist, the system creates it.
The product allocation quantity is overwritten for existing time series. If you also want to change the incoming orders quantity, you must set the interface parameter UPDATE_INCOMING_ORDER_QTY. If the time series does not exist, the system creates it.
Prerequisite
To be able to use this method, you must have made all the Customizing settings for product allocation. For more information, see the Implementation Guide (IMG) for SAP APO under Global Available-to-Promise -> Product Allocation.
Regards
Vinod -
Bapi or FM for T.Code CJIC
Hi ,
I need a BAPI or FM For T.Code CJIC to upload the data, for this BDC is not working.
Pls do the need full.
Regards,
KranthiHi Daniel,
Please try FM CO_IH_ORDER_GENER_2.
CALL FUNCTION 'CO_IH_ORDER_GENER_2'
EXPORTING
AUART = RIWO00-AUART
GEWRK = VIQMEL-ARBPL
GEWRK_OBJTY = VIQMEL-CROBJTY
VIQMEL_I = VIQMEL
IMPORTING
AUFNR = VIQMEL-AUFNR.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful. -
BAPI or FM for Material and ChapterID Combination(J1ID Transaction)
Dear All,
I need BAPI or FM for Creation of Material and ChapterID combination. I dont need for other options present in J1ID Transaction.
I cannot use Insert statement for Material and ChapterID Creation as it contains only few fields.
Please let me know regarding this.
Regards,
AnilkumarHello
The bapi BAPI_INSPECTIONPLAN_CREATE is used for creation. There you can assign several materials through structure MATERIALTASKALLOCATION (BAPI1191_MTK_C). There is no bapi for modifications so you can assign other materials using LSMW or BDC as Gururaj told you or in this special case populate table MAPL directly (better talk to your ABAP to decide it); I did it without issues and I checked and the function CZ_VB_MAPL_POST could update the information you need (talk to your ABAP to validate it).
Best regards
Carlos Díaz
Maybe you are looking for
-
ITunes only works when IPOD is connected
My ITunes only opens and can be used if my IPOD is connected. I have re-installed ITunes twice now, but the re-installing does not seem to fix the problem. Any ideas as to how I can access ITunes on my PC without connecting my IPOD? I have a PC with
-
Monitor question/issue in photoshop
I have a 23inch Apple Cinema Display. It is about 4-5 years old. I do mostly print work. LAtely I have been getting jobs back where my silouhettes (not clipping paths-- just silos against white) have been sloppy around the edges. It turns out that I
-
"Root element is missing." - While using Sharepoint List Source in SSIS.
Hi Team, We are trying to import data from sharepoint list using sharepointlist source in SSIS. But the following error pops-up. [SP_SRC_SharePointList [67]] Error: System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.
-
Can somebody decipher this? Kinda long...sorry
Date/Time: 2006-08-27 14:56:26.296 -0400 OS Version: 10.4.7 (Build 8J2135a) Report Version: 4 iChat Connection Log: AVChat started with ID 3776362454. elutzy73: State change from AVChatNoState to AVChatStateWaiting. 0x1845a040: State change from AVCh
-
Hi, I am trying to customize the subtotal row text. By default(in OBIE11G Analysis) we get COLUMN NAME total ( example "PRODUCT Total"), and if we want to have a customized subtotal text, then we can have whatever text we want to(in edit view, subtot