BAPI for Characteristic Dependency
Hi Friends,
We need to maintain the Characteristics & their dependency in each client as it is Master data. As per my knowledge we can use to create them through Mass upload like LSMW, BDC or BAPI. Since the data is very huge, is there any way to do.
When I was checking u201CBAPI_CHARACT_CREATEu201D , I couldnu2019t find there is option for Dependency upload. Is there any other BAPI for this.
Regards,
Sai Krishna
Hi Sai,
For each characteristic you need to assign dependancy separately and also if a charactistic is having multiple values, there also you need to assign dependancies separately. This is standrad behaviour.
As on date there is no BAPI or any other method to assign single dependacy to multiple characteristics or values at a time.
but this can be achived without using dependancy editor. Write a z-program for additional data so that only those fields can be displayed which are required after one single field( single characteristic). It will be out of dependancy editor and separate program. for this you may use function module BAPI_DOCUMENT_GETDETAIL2.
Hope this will help.
Regards,
Ravindra
Similar Messages
-
FM or BAPI for Group Dependency
hi experts,
i need to create Dependency with Dependency group through Report program.
T-Code CU01.
please help me to find out any BAPI or FM for the same.
Thanks in advance,
AmolHi,
use BAPI_PO_CREATE, po_header-doc_type = 'UB'
Thanks,
Reward If Helpful. -
Bapi for sfg dependent dem,snp planned order qty, and ppds planned orde qty
Hi Gurus,
I am not much familiar with APO, so please help me,
Input details:
Field Value
Planning Version 000
Source Location * 1001 Single/Multi Value
Product * 1000061 Single/Multi Value
Production Planner * PRC Single/Multi Value
Start Date *
End Date *
o/p:
Source Location Date Semi-Finished Material Material Description SFG Dependent Demand SNP Planned Orders qty PPDS Planned order Qty Total SFG Variance due to Lot size Total SFG Variance reference to dependent demand
1001 15-Jul-10 1000041PP PRIMARY FF MILK 3% FAT 340 412 420 8 80
1001 15-Jul-10 1000041PP PRIMARY FF MILK 3% FAT
1001 15-Jul-10 1000041PP PRIMARY FF MILK 3% FAT
Is there any bapi to fetch the data as shown in o/p.
ThanksHi Phani,
Tryout the below BAPIs
IF10503 (object)
BUS10503
Regards
R. Senthil Mareeswaran. -
BAPI for characteristics and classes
Hi all,
I need to upload classifications, characteristics and characteristics value
and classes to the master and also need to extract the same from the material master..
Can any one of you suggest me any BAPI of function module or any othe way so as to implement the above requirement..
Useful answers will be rewarded..
Thanks in advance..
ArunHi,
Check all,
BAPI_CLASS_ALLOC_GLOB_DEP BAPI: Assign Global Dependencies to Class
BAPI_CLASS_CHANGE BAPI: Change Class
BAPI_CLASS_CHARVALUE_DEL_DEP Class BAPI: Delete Local / Global Dependencies for Characteristic Valu
BAPI_CLASS_CHARVALUE_GLOB_DEP Class BAPI: Assign Global Dependencies to Characteristic Value
BAPI_CLASS_CHARVALUE_LOCAL_DEP Class BAPI: Maintain Local Dependency for Characteristic Value
BAPI_CLASS_CHARVALUE_READ_ALLO Class BAPI: Read Dependencies for Characteristic Value
BAPI_CLASS_CHAR_ALLOC_GLOB_DEP Class BAPI: Global Dependencies for Characteristic
BAPI_CLASS_CHAR_DELETE_DEP Class BAPI: Delete Global / Local Dependency for Characteristic
BAPI_CLASS_CHAR_LOCAL_DEP Class BAPI: Assign / Delete Local Dependency for Characteristic
BAPI_CLASS_CHAR_READ_ALLOC Class BAPI: Read Dependencies for Characteristic
BAPI_CLASS_CHAR_VALUE_TEXT_DEL Class BAPI: Delete Overwriting of Long Text for Characteristic or Value
BAPI_CLASS_CHAR_VALUE_TEXT_OVR Class BAPI: Overwriting of Long Text for Characteristic or Value
Reward if useful! -
BAPI for fill class characteristics
Hi,
Wich BAPI schould I use to fill class characteristics,
where class is associated with batch.
Please it's very important
Regards,
Greg.BAPI_CLASS_ALLOC_GLOB_DEP BAPI: Assign Global Dependencies to Class
BAPI_CLASS_CHANGE BAPI: Change Class
BAPI_CLASS_CHARVALUE_DEL_DEP Class BAPI: Delete Local / Global Dependencies for Characteristic Valu
BAPI_CLASS_CHARVALUE_GLOB_DEP Class BAPI: Assign Global Dependencies to Characteristic Value
BAPI_CLASS_CHARVALUE_LOCAL_DEP Class BAPI: Maintain Local Dependency for Characteristic Value
BAPI_CLASS_CHARVALUE_READ_ALLO Class BAPI: Read Dependencies for Characteristic Value
BAPI_CLASS_CHAR_ALLOC_GLOB_DEP Class BAPI: Global Dependencies for Characteristic
BAPI_CLASS_CHAR_DELETE_DEP Class BAPI: Delete Global / Local Dependency for Characteristic
BAPI_CLASS_CHAR_LOCAL_DEP Class BAPI: Assign / Delete Local Dependency for Characteristic
BAPI_CLASS_CHAR_READ_ALLOC Class BAPI: Read Dependencies for Characteristic
BAPI_CLASS_CHAR_VALUE_TEXT_DEL Class BAPI: Delete Overwriting of Long Text for Characteristic or Value
BAPI_CLASS_CHAR_VALUE_TEXT_OVR Class BAPI: Overwriting of Long Text for Characteristic or Value
Just check these FM
Regards,
Pavan P. -
Can u tell me any predefined BAPI for change and creation of Material
Hi,
Can anybody tell me predefined BAPI for change and creation of Materialmasterand Pricing?
Thanks & regards,
Gopianne.you can use the BAPI to BAPI_MATERIAL_SAVEDATA create as well as to change material master.
When changing material master data, you need enter only the material
number.
In the header data, you must select at least one view for which data is
to be created. Depending on the view selected, you must maintain other
required parameters. If you do not enter values for all of the required
parameters, the method is ended with an error message.
The corresponding fields in the tables (such as CLIENTDATA) must first
be supplied with data by the calling program. An indicator must also be
set for each of these fields so that the data is written to the database
by the method. This requires the calling program to supply the
corresponding field with the indicator in a checkbox table (for example,
CLIENTDATAX). Checkbox tables exist for tables that do not contain any
language-dependent texts (MAKT, MLTX), International Article Numbers
(MEAN), or tax classifications (MLAN). Several data records for a
material can be created in these tables.
regards
vivek
reward points if it helps -
Alternate BAPI for BAPI_SALESDOCUMENT - Mass creation
We are trying to mass create Schedule lines for the SD contract items through the BAPI "BAPI_SALESDOCUMENT_CHANGE". The performance is very slow for bulk items.
This scedule line creation is equivalent to creating scedule lines through the transaction VA42.
Is there any alternate function module or BAPI for mass creation of schedule lines for the SD contract?Depends on your release: in ECC 6.0 i have BAPI_SALESORDER_CREATEFROMDAT2
Nevermind: it's contracts not salesorder.
Try BAPI_CUSTOMERCONTRACT_CHANGE or do a F4 on BAPICONTRACT
Edited by: Maen Anachronos on Sep 16, 2010 1:19 PM -
BAPI for transaction FB01 with account posting key
Hi,
I have to use a BAPI for registering Invoices into the FI module through the FB01 transaction.
I am trying to use the standard BAPI: BAPI_ACC_DOCUMENT_POST
The problem is that this BAPI does not manage the account posting key (field BSCHL).
Could anyone provide help?
Thank you very much in advance.It is happening here in the BAPI
CALL FUNCTION 'FI_GET_POSTING_KEY'
EXPORTING
i_ktosl = gs_accit-ktosl
IMPORTING
e_bschs = ld_bschs
e_bschh = ld_bschh
e_umskz = ld_umskz
EXCEPTIONS
error_message = 1.
As max pointed out, it is dependent on the transaction key(KTOSL).
Srinivas -
BAPI for ""Change Cost Element / Activity Input Planning ""
Hi
Is there any BAPI for ""Change Cost Element / Activity Input Planning "" ( TC KP06) as there is BDC for that but is goes through lot of steps . ( TC OKKS, KP04, KP06 )
So if any one know the BAPI for the same please let me know, and if possible send me your code also it will be really help full.
Regardso OBJECT_INDEX - Index uniquely identifying the row and thus the
object. The index must be greater than zero and may only appear once
in the table. If the index does not exist in INDEXSTRUCTURE, the row
is ignored.
o COSTCENTER - Cost center that includes the activity.
o ACTTYPE - Activity type that includes the activity. You must
fill this together with COSTCENTER. You only need it for an activity
input that is activity-dependent.
o CO_BUSPROC - Business process that includes the activity.
o ORDERID - Order that includes the activity.
o WBS_ELEMENT - WBS element that includes the activity
You may fill one object only,for example COSTCENTER, CO_BUSPROC,
ORDERID, or WBS_ELEMENT. -
VB11 - CREATE MATERIAL DETERMINATION. need a BAPI for this
i have to develop an inbound interface program to create VB11 - CREATE MATERIAL DETERMINATION.
Can any one suggest me if there is any BAPI for doing this insted of going to BDC program .
Regards
RaadhaI don't think there will be any BAPI to do the update as material determination is itself dynamic depending upon which determination type you chose from - the key field combination changes accordingly. Just like updating pricing doesn't have any general purpose BAPI.
I think BDC is the only way out here -
Hey SAP Experts,
Is there any BAPI for the purchase data in KONV table?
Could anyone provide this?
Ample points will be rewarded.Hello Prathibha,
Take a look at function module KONV_UPDATE to see if it can help you.
Depending on the value that you indicate in PI_UPDKZ, it allows you to make INSERT's, MODIFY's and DELETE's on table KONV. The values you can indicate on table parameter PI_T_KONV.
Kind regards,
Bruno -
Pls suggest right BAPI FOR Tcode(MSC2N)
Hi All,
I am uploading the data(characteristic values) through the Tcode MSC2N When I am trying to do this through bdc it's not allowing to change characteristic values?What will be the problem?we can use the BAPI BAPI_OBJCL_CHANGE but this bapi will only change the characteristic values but I also need to change date1 field(this is there in the Basic data2in the same transaction MSC2N) Can any body suggest how to do this please?
Thanks&Regards
MaheshHay Mahesh
Try with the following BAPI's
BAPI_OBJCL_CREATE Classification BAPI: Create Assignment
BAPI_OBJCL_CREATE_KEY BAPI for Classification: Create Assignment (Key)
Thanks & regards
Sreenivasulu P -
can any one send any program for uploading data through bapi for any infotype. so that i can understand bapi for infotypes.
hi
just create a message class and text according to the code as follows (copy and paste in se 38)
REPORT ZCHR007_01 NO STANDARD PAGE HEADING MESSAGE-ID ZHR LINE-COUNT 65(8) LINE-SIZE 180.
TABLES : PA0003, P0000,P0006,T005S,T005,T591A. " TABLES REQUIRED
*INTERNAL TABLE AND WORK AREA WITH STRUCTURE ON BASIS FLAT FILE DATA.
TYPES : BEGIN OF x_flat_infotype, "Flat file structure
Screen data
PERNR TYPE PERSNO, "Personal Number
BEGDA TYPE BEGDA, "Begin Date
ENDDA TYPE ENDDA, "End Date
ANSSA TYPE ANSSA, "Address Record Type
STRAS TYPE PAD_STRAS, "House number and street
LOCAT TYPE PAD_LOCAT, "2nd Address Line
PSTLZ TYPE PSTLZ_HR, "Postal Code
ORT01 TYPE PAD_ORT01, "City
ORT02 TYPE PAD_ORT02, "District
STATE TYPE REGIO, "State
land1 TYPE land1, "Country
telnr TYPE telnr, "Telephone Number
wkwng TYPE wkwng, "Company Housing
END OF x_flat_infotype.
TYPES : BEGIN OF x_valid.
INCLUDE TYPE x_flat_infotype. "structure for valid data
TYPES : END OF x_valid.
TYPES : BEGIN OF x_invalid.
INCLUDE TYPE x_flat_infotype. "structure for invalid data
TYPES : error TYPE string, "string to hold error field details
END OF x_invalid,
BEGIN OF x_pernr, "STRUCTURE DECLARATION FOR Personal No
pernr TYPE persno,
END OF x_pernr,
BEGIN OF x_state, "STRUCTURE DECLARATION FOR Region
land1 type land1,
state TYPE regio,
END OF x_state,
BEGIN OF x_land1, "STRUCTURE DECLARATION FOR Country
land1 TYPE land1,
END OF x_land1.
DATA : t_infotype TYPE STANDARD TABLE OF x_flat_infotype INITIAL SIZE 0, "internal table to hold data
t_valid TYPE STANDARD TABLE OF x_valid INITIAL SIZE 0, "internal table to hold valid data
t_invalid TYPE STANDARD TABLE OF x_invalid INITIAL SIZE 0, "internal table to hold invalid data
t_v_final TYPE STANDARD TABLE OF x_valid INITIAL SIZE 0, "internal table to hold valid data
DECLARE IT_BDCDATA INTERNAL TABLE BASED ON BDCDATA STRUCTURE
t_bdcdata TYPE STANDARD TABLE OF bdcdata INITIAL SIZE 0, "internal table to hold BDC data
Work area for the above internal tables
wa_infotype TYPE x_flat_infotype, "work area to hold data
wa_valid TYPE x_valid, "work area to hold valid data
wa_invalid TYPE x_invalid, "work area to hold invalid data
wa_v_final TYPE x_valid, "work area to hold valid data
wa_bdcdata TYPE bdcdata, "work area to hold BDC data
g_file TYPE string, "Variable to hold file name entered by user
g_errfile TYPE string. "Variable to hold file name entered by user
MAINTAINING A BLOCK WITH FLAT FILE AS INPUT
PARAMETER : p_file TYPE fc03tab-pl00_file OBLIGATORY. "variable to hold flat file name during runtime
INITIALIZATION.
PERFORM sub_refreshing_inttables. "Subroutine for refreshing all internal tables
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM sub_get_file USING p_file. "TO SELECT A FILE USING F4 KEY.
START-OF-SELECTION.
PERFORM sub_upload_file. " UPLOADING FILE WITH DATA
PERFORM sub_file_validations. " flat file validations
IF NOT t_valid[] IS INITIAL. "checking for valid data
PERFORM sub_data_updatation. "updation of data depending on selected method
ENDIF.
IF NOT t_invalid[] IS INITIAL.
PERFORM sub_download_error_file. "TO DOWNLOAD ERRROR FILE
ENDIF.
Perform sub_details. "Subroutine for loading details
END-OF-SELECTION.
PERFORM sub_free. "TO Free Memory
*& Form sub_refreshing_inttables
"Subroutine for refreshing all internal tables
FORM sub_refreshing_inttables . "REFRESH ALL INTERNAL TABLES
REFRESH : t_infotype,t_valid,t_invalid,t_bdcdata.
ENDFORM. " sub_refreshing_inttables
*& Form sub_get_file
Subroutine for selection a file during runtime
-->P_P_FILE Input File
FORM sub_get_file USING p_p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
field_name = 'PA_FILE'
CHANGING
file_name = p_p_file.
ENDFORM. " sub_get_file
*& Form sub_upload_file
Subroutine for uploading data into internal table
FORM sub_upload_file.
CONSTANTS : lc_ftype TYPE char10 VALUE 'ASC',
lc_fsepe TYPE char01 VALUE 'X'.
g_file = p_file. "STORE FILENAME IN VARIABLE(g_FILE)
IF p_file IS INITIAL. " if file is not selected
MESSAGE i002.
LEAVE LIST-PROCESSING.
ELSE.
CALL FUNCTION 'GUI_UPLOAD' "CALLLING FUNCTION TO UPLOAD THE FILE DATA
EXPORTING
filename = g_file
filetype = lc_ftype
has_field_separator = lc_fsepe
TABLES
data_tab = t_infotype
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 to display is file is not selected
MESSAGE i001.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " sub_upload_file
*& Form sub_file_validations
Subroutine for validating required fields in flat file
FORM sub_file_validations .
CONSTANTS: lc_anssa1 TYPE char04 VALUE '1', "Constant address type
lc_anssa2 TYPE char04 VALUE '2', "Constant address type
lc_anssa3 TYPE char04 VALUE '3', "Constant address type
lc_anssa4 TYPE char04 VALUE '4', "Constant address type
lc_wkwng1 TYPE char01 VALUE '1', "Constant Company Housing
lc_wkwng2 TYPE char01 VALUE '2'. "Constant Company Housing
DATA : t_pernr TYPE STANDARD TABLE OF x_pernr INITIAL SIZE 0, "INTERNAL TABLE FOR Personal No data
t_state TYPE STANDARD TABLE OF x_state INITIAL SIZE 0, "INTERNAL TABLE FOR Region data
t_land1 TYPE STANDARD TABLE OF x_land1 INITIAL SIZE 0. "INTERNAL TABLE FOR Country data
IF t_infotype IS NOT INITIAL.
validate Personal No
SELECT pernr FROM pa0003 INTO TABLE t_pernr " Extracting Personal No Data FROM TO VALIDATE THE FIELD
FOR ALL ENTRIES IN t_infotype WHERE pernr = t_infotype-pernr.
IF sy-subrc = 0.
SORT t_pernr BY pernr.
ENDIF.
validate Region
SELECT land1 bland FROM t005s INTO TABLE t_state . " Extracting Region DATA FROM TO VALIDATE THE FIELD
IF sy-subrc = 0.
SORT t_state BY land1 state.
ENDIF.
validate Country
SELECT land1 FROM t005 INTO TABLE t_land1 . " Extracting country DATA FROM TO VALIDATE THE FIELD
IF sy-subrc = 0.
SORT t_land1 BY land1 .
ENDIF.
ELSE.
MESSAGE i004.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR wa_infotype. "clearing data from work area of infotype internal table
LOOP AT t_infotype INTO wa_infotype.
PERFORM sub_valid_nonvalidatefield.
PERFORM sub_startdate_validaion. "Subroutine to validate start date field
PERFORM sub_enddate_validaion. "Subroutine to validate end date field
IF wa_valid-begda GE wa_valid-endda. "If start date is less than or equal to end date
wa_invalid-begda = wa_infotype-begda. "moving start date to invalid workarea of start date
wa_invalid-endda = wa_infotype-endda. "moving start date to invalid workarea of start date
CONCATENATE text-032 wa_invalid-begda
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
validate field Address Type of flat file with field in check table
IF wa_infotype-anssa = lc_anssa1 OR wa_infotype-anssa = lc_anssa2
OR wa_infotype-anssa = lc_anssa3 OR wa_infotype-anssa = lc_anssa4 .
wa_valid-anssa = wa_infotype-anssa. "moving Address type from internal table to valid internal table
ELSE.
wa_invalid-anssa = wa_infotype-anssa. "moving Address type from internal table to invalid internal table
CONCATENATE text-033 wa_invalid-anssa
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
validate field Personal No of flat file with field in check table
READ TABLE t_pernr WITH KEY pernr = wa_infotype-pernr
BINARY SEARCH
TRANSPORTING NO FIELDS .
IF sy-subrc = 0. "checking for validation of the Personal No
wa_valid-pernr = wa_infotype-pernr. "moving Personal No from internal table to valid internal table
ELSE.
wa_invalid-pernr = wa_infotype-pernr. "moving Personal No from internal table to invalid internal table
CONCATENATE text-030 wa_invalid-pernr
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
validate field State of flat file with field in check table
READ TABLE t_state WITH KEY land1 = wa_infotype-land1 STATE = wa_infotype-state
BINARY SEARCH
TRANSPORTING NO FIELDS .
IF sy-subrc = 0. "checking for validation of the State
wa_valid-state = wa_infotype-state. "moving State from internal table to valid internal table
ELSE.
wa_invalid-state = wa_infotype-state. "moving State from internal table to invalid internal table
CONCATENATE text-010 wa_invalid-state
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
validate field Country of flat file with field in check table
READ TABLE t_land1 WITH KEY land1 = wa_infotype-land1
BINARY SEARCH
TRANSPORTING NO FIELDS .
IF sy-subrc = 0. "checking for validation of the Country
wa_valid-land1 = wa_infotype-land1. "moving Country from internal table to valid internal table
ELSE.
wa_invalid-land1 = wa_infotype-land1. "moving Country from internal table to invalid internal table
CONCATENATE text-011 wa_invalid-land1
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
IF wa_infotype-wkwng = lc_wkwng1 OR wa_infotype-wkwng = lc_wkwng2 .
wa_valid-wkwng = wa_infotype-wkwng. "moving Company Housing from internal table to valid internal table
ELSE.
wa_invalid-wkwng = wa_infotype-wkwng. "moving Company Housing from internal table to invalid internal table
CONCATENATE text-034 wa_invalid-wkwng
wa_invalid-error INTO wa_invalid-error SEPARATED BY space .
ENDIF.
For Invalid data
IF wa_invalid IS NOT INITIAL. "checking all fields data for invalid entries
CONCATENATE text-012
wa_invalid-error INTO wa_invalid-error.
PERFORM sub_invalid_nonvalidatefield.
IF wa_invalid-pernr IS INITIAL.
wa_invalid-pernr = wa_valid-pernr. "Personal No
ENDIF.
IF wa_invalid-begda IS INITIAL.
wa_invalid-begda = wa_valid-begda. "Begin date
ENDIF.
IF wa_invalid-endda IS INITIAL.
wa_invalid-endda = wa_valid-endda. "End Date
ENDIF.
IF wa_invalid-anssa IS INITIAL.
wa_invalid-anssa = wa_valid-anssa. "Address Type
ENDIF.
IF wa_invalid-state IS INITIAL.
wa_invalid-state = wa_valid-state. "State
ENDIF.
IF wa_invalid-land1 IS INITIAL.
wa_invalid-land1 = wa_valid-land1. "Country
ENDIF.
APPEND wa_invalid TO t_invalid. "Appending data to invalid internal table
ELSE.
APPEND wa_valid TO t_valid. "Appending data to valid internal table
ENDIF.
CLEAR wa_valid.
CLEAR wa_invalid.
ENDLOOP.
ENDFORM. " sub_file_validations
*& Form sub_valid_nonvalidatefield
Subroutine for updating non-validated fields into valid work area
FORM sub_valid_nonvalidatefield .
wa_valid-stras = wa_infotype-stras. "moving Str&Hou from internal table to valid internal table
wa_valid-locat = wa_infotype-locat. "moving 2nd Address line from internal table to valid internal table
wa_valid-pstlz = wa_infotype-pstlz. "moving Postal Code from internal table to valid internal table
wa_valid-ort01 = wa_infotype-ort01. "moving City from internal table to valid internal table
wa_valid-ort02 = wa_infotype-ort02. "moving District from internal table to valid internal table
wa_valid-telnr = wa_infotype-telnr. "moving Telephone No from internal table to valid internal table
ENDFORM. " sub_valid_nonvalidatefield
*& Form sub_startdate_validaion
"Subroutine to validate start date field
FORM sub_startdate_validaion .
*This Funciton module is used for Conversion of date, ie External to
*internal date (like screen conversion)
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = wa_infotype-begda "External date or date given in flat file
IMPORTING
date_internal = wa_valid-begda "Date converted to internal format for conversion
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0. "If conversion of date fails
wa_invalid-begda = wa_infotype-begda. "moving date from flat file work area to inavlid work area
CONCATENATE text-035 wa_invalid-begda
wa_invalid-error INTO wa_invalid-error SEPARATED BY space. " Adding start date error to error field of invalid internal table
ENDIF.
ENDFORM. " sub_startdate_validaion
*& Form sub_enddate_validaion
"Subroutine to validate end date field
FORM sub_enddate_validaion .
*This Funciton module is used for Conversion of date, ie External to
*internal date (like screen conversion)
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = wa_infotype-endda "External date or date given in flat file
IMPORTING
date_internal = wa_valid-endda "Date converted to internal format for conversion
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0. "If conversion of date fails
wa_invalid-endda = wa_infotype-endda. "moving date from flat file work area to inavlid work area
CONCATENATE text-036 wa_invalid-endda
wa_invalid-error INTO wa_invalid-error SEPARATED BY space. " Adding end date error to error field of invalid internal table
ENDIF.
ENDFORM. " sub_enddate_validaion
*& Form sub_invalid_nonvalidatefield
Subroutine for updating non-validated fields into invalid work area
FORM sub_invalid_nonvalidatefield .
wa_invalid-stras = wa_infotype-stras. "moving Str&Hou from internal table to invalid internal table
wa_invalid-locat = wa_infotype-locat. "moving 2nd Address line from internal table to invalid internal table
wa_invalid-pstlz = wa_infotype-pstlz. "moving Postal Code from internal table to invalid internal table
wa_invalid-ort01 = wa_infotype-ort01. "moving City from internal table to invalid internal table
wa_invalid-ort02 = wa_infotype-ort02. "moving District from internal table to invalid internal table
wa_invalid-telnr = wa_infotype-telnr. "moving Telephone No from internal table to invalid internal table
ENDFORM. " sub_invalid_nonvalidatefield
*& Form sub_data_updatation
Subroutine for updation of data depending on selected method
FORM sub_data_updatation .
DATA : wa_return_enque TYPE bapireturn1. "variable to store error values
clear wa_return_enque.
LOOP AT t_valid INTO wa_valid. "moving valid data to valid work area
PERFORM sub_bapi_employee_enqueue using wa_return_enque . "Subroutine to lock an employee
IF wa_return_enque-type NE 'E'.
PERFORM sub_bapi_addressempdk_create. "Subroutine to create employee address data
ENDIF.
ENDLOOP.
ENDFORM. " sub_data_updatation
*& Form sub_bapi_employee_enqueue
Subroutine to lock an employee
<--P_WA_RETURN_ENQUE wa_return_enque-type
FORM sub_bapi_employee_enqueue using p_wa_return_enque LIKE bapireturn1.
*This funciton module is used to lock an employee so that the records
*stored for this person cannot be accessed.
*When an employee is locked, only user who has set lock can access
*records for this employee. Other users are denied access.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = wa_valid-pernr "Personal number
IMPORTING
return = p_wa_return_enque. "for error values returned
ENDFORM. " sub_bapi_employee_enqueue
*& Form sub_BAPI_ADDRESSEMPDK_CREATE
Subroutine to create employee address data
FORM sub_bapi_addressempdk_create.
DATA : wa_data_create TYPE bapireturn1. "variable to store error values
*This function module is used create a Address Data record (0006).
CALL FUNCTION 'BAPI_ADDRESSEMPDK_CREATE'
EXPORTING
employeenumber = wa_valid-pernr "Personal No
validitybegin = wa_valid-begda "Begin Date
validityend = wa_valid-endda "End Date
addresstype = wa_valid-anssa "Address type
streetandhouseno = wa_valid-stras "Street and house address
scndaddressline = wa_valid-locat "2nd address line
city = wa_valid-ort01 "City
district = wa_valid-ort02 "District
postalcodecity = wa_valid-pstlz "Postal Code
state = wa_valid-state "Region(State)
country = wa_valid-land1 "Country
company_apartment = wa_valid-wkwng "Company Housing
telephonenumber = wa_valid-telnr "Telephone No
IMPORTING
return = wa_data_create
employeenumber = wa_valid-pernr
subtype = wa_valid-anssa
validitybegin = wa_valid-begda
validityend = wa_valid-endda.
If error or abend message occurs while uploading data, then moving all the wa_valid fields to wa_invalid fields.
IF wa_data_create-type EQ 'E'
OR wa_data_create-type EQ 'A'.
PERFORM sub_bapi_employee_dequeue. "Subroutine to unlock an employee
wa_invalid-pernr = wa_valid-pernr . "Personal No
wa_invalid-begda = wa_valid-begda . "Begin Date
wa_invalid-endda = wa_valid-endda . "End Date
wa_invalid-anssa = wa_valid-anssa . "Address type
wa_invalid-stras = wa_valid-stras . "Street and house address
wa_invalid-locat = wa_valid-locat . "2nd address line
wa_invalid-ort01 = wa_valid-ort01 . "City
wa_invalid-ort02 = wa_valid-ort02 . "District
wa_invalid-pstlz = wa_valid-pstlz . "Postal Code
wa_invalid-state = wa_valid-state . "Region(State)
wa_invalid-land1 = wa_valid-land1 . "Country
wa_invalid-telnr = wa_valid-telnr . "Telephone No
wa_invalid-wkwng = wa_valid-wkwng . "Company Housing
wa_invalid-error = wa_data_create-message.
APPEND wa_invalid TO t_invalid. "appending wa_invalid to internal table
ELSE.
APPEND wa_valid TO t_v_final. "appending wa_valid to another internal table for the final count of valid records
ENDIF.
CLEAR: wa_invalid, "clearing work area of invalid
wa_valid. "clearing work area of valid
ENDFORM. " sub_BAPI_ADDRESSEMP_CREATE
*& Form sub_bapi_employee_dequeue
Subroutine to unlock an employee
FORM sub_bapi_employee_dequeue .
DATA : wa_return_deque TYPE bapireturn1.
*This function module is used to unlock an employee so that the records
*stored for this person can be accessed.
*If an employee is locked using the ENQUEUE method,the user who set the
*lock can access this employee's records.
*Other users are denied access to these records.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = wa_valid-pernr "Personal number
IMPORTING
return = wa_return_deque. "for error values returned
ENDFORM. " sub_bapi_employee_dequeue
*& Form sub_download_error_file
Subroutine to download error file for rectifications
FORM sub_download_error_file .
PROVIDE A VARIABLE FOR HOLDING FLAT FILE
CONSTANTS : lc_ftype TYPE char10 VALUE 'ASC',
lc_fsepe TYPE char01 VALUE 'X',
lc_err TYPE char5 VALUE '_err.', "constant to change error file name
lc_period TYPE c VALUE '.'. "constant to change error file name
g_errfile = p_file. "STORE FILENAME IN VARIABLE(l_FILE)
SHIFT g_errfile BY 4 PLACES RIGHT CIRCULAR.
REPLACE lc_period WITH lc_err INTO g_errfile. "lc_err to truncate .txt and lc_period to add _err.txt
SHIFT g_errfile BY 8 PLACES LEFT CIRCULAR.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = g_errfile
filetype = lc_ftype
write_field_separator = lc_fsepe
TABLES
data_tab = t_invalid
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc NE 0.
MESSAGE i003.
ENDIF.
ENDFORM. " sub_download_error_file
*& Form sub_details
Subroutine for loading details
FORM sub_details .
DATA: l_count_total TYPE i, "variable to count total no of records
l_count_valid TYPE i, "variable to count no of records uploaded
l_count_invalid TYPE i. "variable to count total no of error records
ULINE.
WRITE :/71 text-018 . "title
DESCRIBE TABLE t_infotype LINES l_count_total. "To count no of lines in internal table
WRITE :/,text-019 ,30 text-020, 32 l_count_total,157 text-021,164 text-020, 166 sy-datum.
DESCRIBE TABLE t_v_final LINES l_count_valid. "To count no of lines in internal table
WRITE : text-022,30 text-020,32 l_count_valid,157 text-023,164 text-020, 166 sy-uzeit.
DESCRIBE TABLE t_invalid LINES l_count_invalid. "To count no of lines in internal table
WRITE : text-025,30 text-020,32 l_count_invalid,157 text-024,164 text-020, 166 sy-uname.
WRITE :/,text-026 ,30 text-020 , 40 g_file . "name of the error file
Print if only invalid records exist
IF NOT t_invalid[] IS INITIAL.
WRITE :/,text-027 ,30 text-020 , 40 g_errfile . "variable to count total no of error records
IF t_invalid IS INITIAL.
g_errfile = text-029.
ENDIF.
WRITE :/ text-028.
ULINE.
WRITE :/ sy-vline,2 text-030,17 sy-vline, 20 text-031,178 sy-vline. "headings -
BAPI for Sampling scheme and Quality Info Record in QM Module.
Hi techies,
I have a two object(Sampling Scheme,Quality info record) for which i need a BAPI for uploading the data.
Please tell me if any one knows.
Richard.Vineeth,
Usually, I wouldn't think the follow-up action would be an issue with system performance. You say 7000 items, but do you mean 7000 UD's? I.e. an inspection lot of 1000 units isn't unusual and that would be 7 inspection lots. You've also now said that the program needs to look across plants for UD rejections and for notifications. That is another level of complexity.
While the UD follow-up action should still be able to handle that, I can't say it won't affect performance. I was going to suggest you have it only run on certain UD codes, but since you now need to reveiw this across plants that might not work.
What happens if my vendor/material is in a skip stage at plant A and Plant B opens a notification agains the vendor? Since there is no UD, the follow-up action wouldn't run and change the DMR at plant A.
If you need to look at a bunch of stuff, instead of the follow-up action, you may need to run a program in batch and have it run once an hour or every 10 minutes. Depending on how you write it, it could be pretty efficient.
Craig -
BAPI for Creating Sales Order For Variant Configuration Materials
Dear Gurus,
Before posting this thread, we have referred many SDN threads, OSS notes and other sites for any sort of help..but no success..All threads and other referrals are not much of help as they are kind of incomplete( Perhaps, we are unable to understand them..no offense).
Few checked threads on this subjects are:
http://scn.sap.com/thread/34590
http://scn.sap.com/thread/851070
http://scn.sap.com/community/abap/blog/2014/04/23/update-vc-variant-configuration-data-using-standard-bapi-in-sales-order
http://scn.sap.com/community/abap/blog/2014/07/15/creating-orders-with-variant-configured-items-using-bapisalesordercreatefromdat2
http://scn.sap.com/community/abap/blog/2014/04/23/update-vc-variant-configuration-data-using-standard-bapi-in-sales-order
http://scn.sap.com/thread/120144
OSS: 549563
Well, we're using the BAPI (BAPI_SALESORDER_CREATEFROMDAT2) which creates the sales order successfully but without the characteristic values in line items.
We're passing data to the following parameters - ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_VALUE to create the variant config but not able to see it getting created.
Pls find attached BAPI coding document for your reference.
If you could throw any light on this issue will be of great help for us.
Thank You in Advance!!!
Reg,
Jagan-SD.Jagan nath
Try below.
you would need miimum of 3 segments to pass variant config data using this bapi
ORDER_CFGS_REF for each configurable item
POSEX = ITEM #
CONFIG_id , root_id - Start with 1 and increment it for each configurable line item
ORDER_CFGS_INST
CONFIG_ID - from above
INST_ID - Start with 1 and increment it for each configurable line item
OBJ_TYPE = "MARA'
CLASS_TYPE = '300'
OBJ_KEY = material #
ORDER_CFGS_VALUE
CONFIG_ID for the item, INST_ID for the item
charc for characteristic value
VALUE for characteristic value
Reference thread
How to Fill Configuration Data in BAPI BAPI_SALESORDER_CREATEFROMDAT2
Hope it will solve your issue.
Thanks
Ritesh
Maybe you are looking for
-
How to set deletion indicator to SERVICE ENTRY SHEET
Dear Experts, Please explain, is it mandatory to set Deletion indicator to Service entry sheet before Start of Archiving Service entry sheet. Also explain Procedural steps to set deletion indicator to service entry sheet. Thanks in Advance
-
Is Camera Raw for Elements 11 fully featured?
Hi. Is Camera Raw for Elements 11 fully featured, or there is another version of Camera Raw with more functions? I use Elements 11 on Mac OSX.
-
Using iPhoto Book Themes in Aperture
I would like to use the iPhoto book themes in Aperture. Anyway of importing them. Thanks, Paul. iMac Intel Core Duo 20", 2 GB RAM Mac OS X (10.4.6) Nikon Coolscan V ED, Nikon D200, Iomega MiniMax
-
Work center & Routings migration
HI, i want to migrate the Work center master Data and Routing master data thru ALE, i didnt get any Process code and message type for those. which is the best process to migrate Work center and Routings Master Data... Reply me ASAP, Regards Sa
-
Can I encrypt my individual folders instead of the whole home folder?
I want to encrypt one specific folder only and not the whole folder especially since we don't really have (and use) multiple user accounts. How can I do that?