Upload the data using BAPI in LSMW
Hi
I want to upload the data using the BAPI in LSMW,but i dont know what value should be passed in
1- Business Object
2- Method
fields.
Ex- Suppose i want to upload the Material Master Data then what should be the value of these two fields.
Thanks
Mrutyunjaya Tripathy
Hi
Sorry to say that i am little bit confuse with your answer
1-The business object already contains some object name wheather i have to give object names or different,As you have mentioned to give the tcode than what tcode that would be
2-If i am giving any internal table name in the method field it is giving me error because this field is related to the business object field
Thanks
Tripathy m
Similar Messages
-
hi,
i am new for bapi , can anyone tell me how to upload data using bapi with example?
plz tell how to find bapi & how to use in coding to upload the data?Hi ,
To find Bapi There a tcode Bapi which will take you to bapi Explorer From there you can find required
the Bapi Function Module and its Documentation .
[ www.sap-img.com/abap/bapi-step-by-step-guidance.htm ]
[http://www.sappro.com/tag.cfm?session=&tag=bapi%20programming]
[https://wiki.sdn.sap.com/wiki/display/Snippets/SalesordercreationusingBAPI]
Regards
Nilesh -
Error while uploading the data using FM"upload"
Hi,
I encountering an error while uploading the data using text file with FM " UPLOAD"
The error is "File does not exist or cannot be opened "
But there is a file with name and extenstion right.
Regards
VishnuYou have to create RC29P-IDNRK(var) using concatenate statement. Try this.
DATA: new_mark TYPE bdcdata-fnam.
CONCATENATE 'RC29P-IDNRK(' var ')' INTO new_mark.
PERFORM bdc_field USING new_mark W_BOM-QTY -
Error in uploading the data using BDC
Hi All,
I developed a BDC to upload the data for Infotype-0195.When I am trying to upload the flatfile using Functional Module option I am getting the error Invalid Date Format.
Can anyone please help me out giving the solution..........
Thanks in advance,
DeepikaHi Avinash,
I am passing the date field in the format MM/DD/YYYY but in the program i am converting to the format YYYYMMDD using concatenate and then passing the value to the FM but still I am getting the error.
For ur convenience I am sending the code
*-- Includes Declaration *
INCLUDE zixx_data_upload.
INCLUDE zixx_conversion_log.
INCLUDE bdcrecx1.
*-- SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK funcmod WITH FRAME TITLE text-t01.
PARAMETERS : p_fm TYPE c AS CHECKBOX.
PARAMETERS : p_ctumod TYPE ctu_mode DEFAULT '0',
p_date TYPE c AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK funcmod.
TYPES Declaration.
Types decalration for flat file structure
*Declaration for internal table/wa for flat file structure
TYPES: BEGIN OF gt_data,
pernr TYPE rp50g-pernr,
begda(10) TYPE c,
endda(10) TYPE c,
gcase TYPE pb10_gcase,
objps TYPE p0195-objps,
ordcd TYPE p0195-ordcd,
rulid TYPE p0195-rulid,
ibaln(13) TYPE c,
deduc(13) TYPE c,
dedut TYPE p0195-dedut,
li1no TYPE q0195-li1no,
li1ex TYPE q0195-li1ex,
nval1(13) TYPE c,
nuni1 TYPE p0195-nuni1,
li2no TYPE q0195-li1no,
li2ex TYPE q0195-li2ex,
nval2(13) TYPE c,
nuni2 TYPE p0195-nuni2,
addno TYPE q0195-addno,
addex TYPE q0195-addex,
addvl(13) TYPE c,
addun TYPE p0195-addun,
fstat TYPE p0195-fstat,
exemp TYPE p0195-exemp,
addde TYPE p0195-addde,
levda(10) TYPE c,
fild1 TYPE p0195-fild1,
fild2 TYPE p0195-fild2,
fild3 TYPE p0195-fild3,
fild4 TYPE p0195-fild4,
END OF gt_data,
BEGIN OF gt_0194,
pernr TYPE p0194-pernr,
begda TYPE p0194-begda,
endda TYPE p0194-endda,
subty TYPE p0194-subty,
lifnr TYPE p0194-lifnr,
schid TYPE p0194-schid,
rulnr TYPE p0194-rulnr,
plain TYPE p0194-plain,
orign TYPE p0194-orign,
orcod TYPE p0194-orcod,
ornam TYPE p0194-ornam,
orstr TYPE p0194-orstr,
orort TYPE p0194-orort,
orreg TYPE p0194-orreg,
orcnt TYPE p0194-orcnt,
orplz TYPE p0194-orplz,
lapdy TYPE p0194-lapdy,
lapdt TYPE p0194-lapdt,
gcase TYPE p0194-gcase,
gprio TYPE p0194-gprio,
gcate TYPE p0194-gcate,
gstat TYPE p0194-gstat,
rcvdd TYPE p0194-rcvdd,
rlsdd TYPE p0194-rlsdd,
scrul TYPE p0194-scrul,
END OF gt_0194.
TYPES: BEGIN OF gt_data_d,
pernr TYPE rp50g-pernr,
begda(10) TYPE c,
endda(10) TYPE c,
gcase TYPE pb10_gcase,
objps TYPE p0195-objps,
ordcd TYPE p0195-ordcd,
rulid TYPE p0195-rulid,
ibaln(13) TYPE c,
deduc(13) TYPE c,
dedut TYPE p0195-dedut,
li1no TYPE q0195-li1no,
li1ex TYPE q0195-li1ex,
nval1(13) TYPE c,
nuni1 TYPE p0195-nuni1,
li2no TYPE q0195-li1no,
li2ex TYPE q0195-li2ex,
nval2(13) TYPE c,
nuni2 TYPE p0195-nuni2,
addno TYPE q0195-addno,
addex TYPE q0195-addex,
addvl(13) TYPE c,
addun TYPE p0195-addun,
fstat TYPE p0195-fstat,
exemp TYPE p0195-exemp,
addde TYPE p0195-addde,
fild1 TYPE p0195-fild1,
fild2 TYPE p0195-fild2,
fild3 TYPE p0195-fild3,
fild4 TYPE p0195-fild4,
END OF gt_data_d.
INTERNAL TABLE/WORK AREA Declaration.
*Declaration for internal table/wa for flat file structure
DATA: gi_data TYPE TABLE OF gt_data,
gw_data TYPE gt_data,
gi_0194 TYPE TABLE OF gt_0194,
gw_0194 TYPE gt_0194,
*Declaration for BDCDATA
gi_bdcdata TYPE STANDARD TABLE OF bdcdata,
gw_bdcdata TYPE bdcdata,
*Declaration for BDCMSGCOLL
gi_bdcmsgcoll TYPE TABLE OF bdcmsgcoll,
gw_bdcmsgcoll TYPE bdcmsgcoll,
gi_data_d TYPE TABLE OF gt_data_d,
gw_data_d TYPE gt_data_d,
gw_p0195 TYPE p0195,
gw_p0194 TYPE pa0194.
DATA: gw_return TYPE bapireturn1,
*Declaration for Global Variables
gv_count(5) TYPE c VALUE 0.
*Declaration for constants
CONSTANTS: gc_update VALUE 'L',
gc_msgid(2) VALUE 'PG',
gc_s_msgid(3) VALUE '102',
gc_pa30 TYPE tstc-tcode VALUE 'PA30',
gc_200(3) VALUE '200'.
*-- AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
nodata = ' '.
group = sy-uname.
*To change the screen attributes dynamically.
PERFORM upload_screen_output.
*-- START-OF-SELECTION *
START-OF-SELECTION.
IF p_date = 'X'.
*-- Routine to upload the file data
PERFORM upload USING 'X' "HAS_SEPARATOR
'ASC' "File Type
space "ALT_SEPARATOR Alternate separator
'X' "DISPLAY_ERROR
'X' "ERROR_OCCURRED
gi_data. "TABLE Table to upload into
IF NOT gi_data IS INITIAL.
SELECT pernr begda endda subty
lifnr schid rulnr
plain orign orcod
ornam orstr orort
orreg orcnt orplz
lapdy lapdt gcase
gprio gcate gstat
rcvdd rlsdd scrul
FROM pa0194
INTO TABLE gi_0194
FOR ALL ENTRIES IN gi_data
WHERE pernr = gi_data-pernr
AND gcase = gi_data-gcase.
*-- Routine to perform bdc
IF sy-subrc IS INITIAL.
IF p_fm NE 'X'.
PERFORM bdc.
ELSE.
PERFORM function_module.
ENDIF.
ENDIF.
ENDIF.
ELSE.
*-- Routine to upload the file data
PERFORM upload USING 'X' "HAS_SEPARATOR
'ASC' "File Type
space "ALT_SEPARATOR Alternate separator
'X' "DISPLAY_ERROR
'X' "ERROR_OCCURRED
gi_data_d. "TABLE Table to upload into
IF NOT gi_data_d IS INITIAL.
IF p_fm EQ 'X'.
PERFORM function_module.
ENDIF.
ENDIF.
ENDIF.
*Perform to insert the filename in Z-Table and move the file from New
*to Processed in APP Server.
SORT gi_log BY msg_typ.
READ TABLE gi_log INTO gw_log WITH KEY msg_typ = 'E' BINARY SEARCH.
IF sy-subrc <> '0'.
PERFORM file_moving USING gi_data.
ENDIF.
*-- END-OF-SELECTION *
END-OF-SELECTION.
*-- Routine to display conversion log
PERFORM log_display.
Subroutine Pool
*& Form BDC
Routine to perform bdc
FORM bdc .
*Data declaration for collecting success and error records
DATA: lv_success(5) TYPE c VALUE 0,
lv_begda TYPE string,
lv_rlsdd TYPE string,
lv_lapdt TYPE string,
lv_endda TYPE string,
lv_rcvdd TYPE string.
gv_count = 0.
PERFORM open_group.
SORT gi_0194 BY pernr gcase.
LOOP AT gi_data INTO gw_data.
gv_count = gv_count + 1.
READ TABLE gi_0194 INTO gw_0194 WITH KEY pernr = gw_data-pernr
gcase = gw_data-gcase.
IF sy-subrc = 0.
LOOP AT gi_0194 INTO gw_0194 WHERE gcase = gw_data-grnum.
MOVE gw_0194-begda TO lv_begda.
MOVE gw_0194-endda TO lv_endda.
*FUNCTION MODULE TO CONVERT DATE FORMAT
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = lv_begda
IMPORTING
ef_date = lv_begda.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = lv_endda
IMPORTING
ef_date = lv_endda.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MOD'.
PERFORM bdc_field USING 'RP50G-PERNR'
gw_data-pernr.
PERFORM bdc_field USING 'RP50G-TIMR6'
'X'.
PERFORM bdc_field USING 'RP50G-CHOIC'
'0194'.
PERFORM bdc_field USING 'RP50G-SUBTY'
gw_0194-subty.
PERFORM bdc_dynpro USING 'MP019400' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=GROR'.
PERFORM bdc_field USING 'P0194-BEGDA'
lv_begda.
PERFORM bdc_field USING 'P0194-ENDDA'
lv_endda.
PERFORM bdc_field USING 'P0194-LIFNR'
gw_0194-lifnr.
PERFORM bdc_field USING 'P0194-SCHID'
gw_0194-schid.
PERFORM bdc_field USING 'P0194-RULNR'
gw_0194-rulnr.
PERFORM bdc_field USING 'P0194-pLAIN'
gw_0194-plain.
PERFORM bdc_field USING 'P0194-ORIGN'
gw_0194-orign.
PERFORM bdc_field USING 'P0194-ORCOD'
gw_0194-orcod.
PERFORM bdc_field USING 'P0194-ORNAM'
gw_0194-ornam.
PERFORM bdc_field USING 'P0194-ORSTR'
gw_0194-orstr.
PERFORM bdc_field USING 'P0194-ORORT'
gw_0194-orort.
PERFORM bdc_field USING 'P0194-ORREG'
gw_0194-orreg.
PERFORM bdc_field USING 'P0194-ORCNT'
gw_0194-orcnt.
PERFORM bdc_field USING 'P0194-ORPLZ'
gw_0194-orplz.
PERFORM bdc_field USING 'P0194-LAPDY'
gw_0194-lapdy.
IF gw_0194-lapdt IS NOT INITIAL.
MOVE gw_0194-lapdt TO lv_lapdt.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = lv_lapdt
IMPORTING
ef_date = lv_lapdt.
PERFORM bdc_field USING 'P0194-LAPDT'
lv_lapdt.
ENDIF.
PERFORM bdc_field USING 'P0194-GCASE'
gw_0194-gcase.
PERFORM bdc_field USING 'P0194-GPRIO'
gw_0194-gprio.
PERFORM bdc_field USING 'P0194-GCATE'
gw_0194-gcate.
PERFORM bdc_field USING 'P0194-GSTAT'
gw_0194-gstat.
IF gw_0194-rcvdd IS NOT INITIAL.
MOVE gw_0194-rcvdd TO lv_rcvdd.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = lv_rcvdd
IMPORTING
ef_date = lv_rcvdd.
PERFORM bdc_field USING 'P0194-RCVDD'
lv_rcvdd.
ENDIF.
IF gw_0194-rlsdd IS NOT INITIAL.
MOVE gw_0194-rlsdd TO lv_rlsdd.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = lv_rlsdd
IMPORTING
ef_date = lv_rlsdd.
PERFORM bdc_field USING 'P0194-RLSDD'
lv_rlsdd.
ENDIF.
PERFORM bdc_field USING 'P0194-SCRUL'
gw_0194-scrul.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SPOP-TEXTLINE1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SPOP-TEXTLINE1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_dynpro USING 'MP019500' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0195-BEGDA'
gw_data-begda.
PERFORM bdc_field USING 'P0195-ENDDA'
gw_data-endda.
PERFORM bdc_field USING 'P0195-ORDCD'
gw_data-ordcd.
PERFORM bdc_field USING 'P0195-RULID'
gw_data-rulid.
PERFORM bdc_field USING 'P0195-IBALN'
gw_data-ibaln.
PERFORM bdc_field USING 'P0195-DEDUC'
gw_data-deduc.
PERFORM bdc_field USING 'P0195-DEDUT'
gw_data-dedut.
Begin of Insertion V2.0 by S.NATARAJAN
IF ( ( gw_data-li1no = '1' AND gw_data-li1ex = '' ) OR
( gw_data-li1no = '' AND gw_data-li1ex = '' ) ).
IF ( ( gw_data-li1no = '1' AND gw_data-li1ex = '' ) OR
( gw_data-li1no = '' AND gw_data-li1ex = '' ) OR
( gw_data-li1no = '' AND gw_data-li1ex = '2' ) ).
End of Insertion V2.0 by S.NATARAJAN
PERFORM bdc_field USING 'Q0195-LI1NO'
'X'.
PERFORM bdc_field USING 'P0195-NVAL1'
gw_data-nval1.
PERFORM bdc_field USING 'P0195-NUNI1'
gw_data-nuni1.
Begin of Insertion V2.0 by S.NATARAJAN
ELSEIF gw_data-li1no = '' AND gw_data-li1ex = '2' .
ELSEIF ( gw_data-li1no = '' AND gw_data-li1ex = '1' ) .
End of Insertion V2.0 by S.NATARAJAN
PERFORM bdc_field USING 'Q0195-LI1EX'
'X'.
PERFORM bdc_field USING 'P0195-NVAL1'
gw_data-nval1.
PERFORM bdc_field USING 'P0195-NUNI1'
gw_data-nuni1.
ENDIF.
Begin of Insertion V2.0 by S.NATARAJAN
IF ( ( gw_data-li2no = '1' AND gw_data-li2ex = '' ) OR
( gw_data-li2no = '' AND gw_data-li2ex = '' ) ).
IF ( ( gw_data-li2no = '1' AND gw_data-li2ex = '' ) OR
( gw_data-li2no = '' AND gw_data-li2ex = '' ) OR
( gw_data-li2no = '' AND gw_data-li2ex = '2' ) ).
PERFORM bdc_field USING 'Q0195-LI2NO'
'X'.
PERFORM bdc_field USING 'P0195-NVAL2'
gw_data-nval2.
PERFORM bdc_field USING 'P0195-NUNI2'
gw_data-nuni2.
Begin of Insertion V2.0 by S.NATARAJAN
ELSEIF ( gw_data-li2no = '' AND gw_data-li2ex = '2' ).
ELSEIF ( gw_data-li2no = '' AND gw_data-li2ex = '1' ).
End of Insertion V2.0 by S.NATARAJAN
PERFORM bdc_field USING 'Q0195-LI2EX'
'X'.
PERFORM bdc_field USING 'P0195-NVAL2'
gw_data-nval2.
PERFORM bdc_field USING 'P0195-NUNI2'
gw_data-nuni2.
ENDIF.
Begin of Insertion V2.0 by S.NATARAJAN
IF ( ( gw_data-addno = '1' AND gw_data-addex = '' ) OR
( gw_data-addno = '' AND gw_data-addex = '' ) ).
End of Insertion V2.0 by S.NATARAJAN
IF ( ( gw_data-addno = '1' AND gw_data-addex = '' ) OR
( gw_data-addno = '' AND gw_data-addex = '' ) OR
( gw_data-addno = '' AND gw_data-addex = '2' ) ) .
PERFORM bdc_field USING 'Q0195-ADDNO'
'X'.
PERFORM bdc_field USING 'P0195-ADDVL'
gw_data-addvl.
PERFORM bdc_field USING 'P0195-ADDUN'
gw_data-addun.
Begin of Insertion V2.0 by S.NATARAJAN
*ELSEIF gw_data-addno = '' AND gw_data-addex = '2' .
ELSEIF ( gw_data-addno = '' AND gw_data-addex = '1' ).
End of Insertion V2.0 by S.NATARAJAN
PERFORM bdc_field USING 'Q0195-ADDEX'
'X'.
PERFORM bdc_field USING 'P0195-ADDVL'
gw_data-addvl.
PERFORM bdc_field USING 'P0195-ADDUN'
gw_data-addun.
ENDIF.
PERFORM bdc_dynpro USING 'MP019500' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_dynpro USING 'MP019400' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/EBCK'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SPOP-TEXTLINE1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SPOP-TEXTLINE1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_dynpro USING 'MP019500' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
CALL TRANSACTION gc_pa30 USING gi_bdcdata
MODE p_ctumod
UPDATE gc_update
MESSAGES INTO gi_bdcmsgcoll.
PERFORM bdc_transaction USING gc_pa30.
gi_bdcmsgcoll[] = messtab[].
LOOP AT gi_bdcmsgcoll INTO gw_bdcmsgcoll.
IF gw_bdcmsgcoll-msgnr NE gc_200.
IF gw_bdcmsgcoll-msgid = gc_msgid.
IF gw_bdcmsgcoll-msgnr EQ gc_s_msgid.
ADD 1 TO lv_success.
ENDIF.
ENDIF.
gw_log-msg_id = gw_bdcmsgcoll-msgid.
gw_log-msg_num = gw_bdcmsgcoll-msgnr.
gw_log-msg_key = gw_bdcmsgcoll-msgv1.
gw_log-msg_typ = gw_bdcmsgcoll-msgtyp.
gw_log-rec_no = gv_count.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = gw_log-msg_id
no = gw_log-msg_num
v1 = gw_bdcmsgcoll-msgv1
v2 = gw_bdcmsgcoll-msgv2
v3 = gw_bdcmsgcoll-msgv3
v4 = gw_bdcmsgcoll-msgv4
IMPORTING
msg = gw_log-msg_txt
EXCEPTIONS
not_found = 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.
CONCATENATE gw_log-msg_txt 'for Personnel No -' ''''
gw_data-pernr '''' 'Case -' '''' gw_data-gcase
'''' INTO gw_log-msg_txt SEPARATED BY space.
APPEND gw_log TO gi_log.
REFRESH gi_bdcmsgcoll.
ENDIF.
ENDLOOP.
CLEAR : lv_begda,lv_endda,
lv_lapdt,lv_rlsdd.
ELSE.
gw_log-msg_id = 'CUST'.
gw_log-msg_num = 'XXX'.
gw_log-msg_key = 'USK'.
gw_log-msg_typ = 'E'.
gw_log-rec_no = gv_count.
CONCATENATE 'Case -' '''' gw_data-gcase ''''
'does not exists for Personnel No -'
'''' gw_data-pernr ''''
INTO gw_log-msg_txt SEPARATED BY space.
APPEND gw_log TO gi_log.
ENDIF.
ENDLOOP.
CLEAR : gw_0194, gw_data.
REFRESH gi_bdcdata.
ENDLOOP.
FREE gi_data.
gv_tot_rec = gv_count.
gv_suc_rec = lv_success.
gv_err_rec = gv_count - lv_success.
gv_ifnam = p_upfile.
PERFORM close_group.
ENDFORM. " BDC
*& Form FUNCTION_MODULE
text
FORM function_module .
IF p_date = 'X'.
LOOP AT gi_data INTO gw_data.
gv_count = gv_count + 1.
SELECT SINGLE pernr begda endda subty grnum
FROM pa0194
INTO CORRESPONDING FIELDS OF gw_p0194
WHERE pernr = gw_data-pernr
AND gcase = gw_data-gcase.
IF sy-subrc = 0.
MOVE-CORRESPONDING gw_data TO gw_p0195.
CONCATENATE gw_data-begda6(4) gw_data-begda3(2)
gw_data-begda+0(2)
INTO gw_p0195-begda.
CONCATENATE gw_data-endda6(4) gw_data-endda3(2)
gw_data-endda+0(2)
INTO gw_p0195-endda.
CONCATENATE gw_data-levda6(4) gw_data-levda3(2)
gw_data-levda+0(2)
INTO gw_p0195-levda.
gw_p0195-grnum = gw_p0194-grnum.
gw_p0195-nein1 = ' '.
gw_p0195-nein2 = ' '.
gw_p0195-addin = ' '.
IF ( gw_data-li1no = '' AND gw_data-li1ex = '1' ) .
gw_p0195-nein1 = '1'.
ELSEIF ( gw_data-li1ex = '2' OR gw_data-li1ex = '' ).
gw_p0195-nein1 = '2'.
ENDIF.
IF ( gw_data-li2no = '' AND gw_data-li2ex = '1' ) .
gw_p0195-nein2 = '1'.
ELSEIF ( gw_data-li2ex = '2' OR gw_data-li2ex = '' ).
gw_p0195-nein2 = '2'.
ENDIF.
IF ( gw_data-addno = '' AND gw_data-addex = '1' ) .
gw_p0195-addin = '1'.
ELSEIF ( gw_data-addex = '2' OR gw_data-addex = '' ).
gw_p0195-addin = '2'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = gw_p0195-pernr
IMPORTING
return = gw_return.
IF gw_return-type NE 'E'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0195'
number = gw_p0195-pernr
validityend = gw_p0195-endda
validitybegin = gw_p0195-begda
record = gw_p0195
operation = 'INS'
dialog_mode = p_ctumod "Mod-01
tclas = 'A'
nocommit = ' '
IMPORTING
return = gw_return.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = gw_p0195-pernr.
ENDIF.
IF gw_return IS NOT INITIAL.
gw_log-msg_id = gw_return-id.
gw_log-msg_num = gw_return-number.
CONCATENATE gw_data-pernr gw_data-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = gw_return-type.
gw_log-rec_no = gv_count.
gw_log-msg_txt = gw_return-message.
ELSE.
gw_log-msg_id = 'CUST'.
gw_log-msg_num = '000'.
CONCATENATE gw_data-pernr gw_data-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = 'S'.
gw_log-rec_no = gv_count.
gw_log-msg_txt = 'Record Created'(t02).
ENDIF.
ELSE.
gw_log-msg_id = 'CUST'.
gw_log-msg_num = 'XXX'.
CONCATENATE gw_data-pernr gw_data-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = 'E'.
gw_log-rec_no = gv_count.
gw_log-msg_txt = 'Case does not exists for Personnel No'(t03).
ENDIF.
APPEND gw_log TO gi_log.
CLEAR : gw_log,gw_return,gw_data,gw_p0194,gw_p0195.
ENDLOOP.
ELSE.
LOOP AT gi_data_d INTO gw_data_d.
gv_count = gv_count + 1.
SELECT SINGLE pernr begda endda subty grnum
FROM pa0194
INTO CORRESPONDING FIELDS OF gw_p0194
WHERE pernr = gw_data_d-pernr
AND gcase = gw_data_d-gcase.
IF sy-subrc = 0.
MOVE-CORRESPONDING gw_data_d TO gw_p0195.
CONCATENATE gw_data_d-begda6(4) gw_data_d-begda3(2)
gw_data_d-begda+0(2)
INTO gw_p0195-begda.
CONCATENATE gw_data_d-endda6(4) gw_data_d-endda3(2)
gw_data_d-endda+0(2)
INTO gw_p0195-endda.
gw_p0195-grnum = gw_p0194-grnum.
gw_p0195-nein1 = ' '.
gw_p0195-nein2 = ' '.
gw_p0195-addin = ' '.
IF ( gw_data_d-li1no = '' AND gw_data_d-li1ex = '1' ) .
gw_p0195-nein1 = '1'.
ELSEIF ( gw_data_d-li1ex = '2' OR gw_data_d-li1ex = '' ).
gw_p0195-nein1 = '2'.
ENDIF.
IF ( gw_data_d-li2no = '' AND gw_data_d-li2ex = '1' ) .
gw_p0195-nein2 = '1'.
ELSEIF ( gw_data_d-li2ex = '2' OR gw_data_d-li2ex = '' ).
gw_p0195-nein2 = '2'.
ENDIF.
IF ( gw_data_d-addno = '' AND gw_data_d-addex = '1' ) .
gw_p0195-addin = '1'.
ELSEIF ( gw_data_d-addex = '2' OR gw_data_d-addex = '' ).
gw_p0195-addin = '2'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = gw_p0195-pernr
IMPORTING
return = gw_return.
IF gw_return-type NE 'E'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0195'
number = gw_p0195-pernr
validityend = gw_p0195-endda
validitybegin = gw_p0195-begda
record = gw_p0195
operation = 'INS'
dialog_mode = p_ctumod "Mod-01
tclas = 'A'
nocommit = ' '
IMPORTING
return = gw_return.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = gw_p0195-pernr.
ENDIF.
IF gw_return IS NOT INITIAL.
gw_log-msg_id = gw_return-id.
gw_log-msg_num = gw_return-number.
CONCATENATE gw_data_d-pernr gw_data_d-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = gw_return-type.
gw_log-rec_no = gv_count.
gw_log-msg_txt = gw_return-message.
ELSE.
gw_log-msg_id = 'CUST'.
gw_log-msg_num = '000'.
CONCATENATE gw_data_d-pernr gw_data_d-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = 'S'.
gw_log-rec_no = gv_count.
gw_log-msg_txt = 'Record Created'(t02).
ENDIF.
ELSE.
gw_log-msg_id = 'CUST'.
gw_log-msg_num = 'XXX'.
CONCATENATE gw_data_d-pernr gw_data_d-gcase INTO
gw_log-msg_key SEPARATED BY '|'.
gw_log-msg_typ = 'E'.
gw_log-rec_no = gv_count.
gw_log-msg_txt = 'Case does not exists for Personnel No '(t03).
ENDIF.
APPEND gw_log TO gi_log.
CLEAR : gw_log,gw_return,gw_data_d,gw_p0194,gw_p0195.
ENDLOOP.
ENDIF.
ENDFORM.
Thanks. -
F-22, Need to upload the document using BAPI
we have requirement to use BAPI for uploading document to f-22,
For the BAPI when we input data all the data are correctly posted except posting keys,
Our requirement is to use the customized posting for crediting customer and standard posting key for debiting GL account,
We have input the required posting key in BAPI but still its not picking the posting key, its taking the standard posting key,
Document type used is DC and DB,
so is there any relation between document type and posting key, any idea from where BAPI is picking Posting key?Hello,
it was originally not intended to use the BAPI to post
payment documnents. For simplicity the posting keys are not
at the BAPI's interface, instead they are defaulted with
the standard posting keys depending on account type and debit/credit
indicator.
Please see note 487722 which explains how to pass addditional data
to the BAPI in parameter EXTENSION1. You can implement the
Business Transaction Event (BTE) RWBAPI01 to populate the posting
key (t_accit-bschl) from EXTENSION1 parameter.
I hope this helps!
BR,
Raquel -
Upload the data using sessoin method
HI All,
i have a flat file of 1000 records i uploaded 1000 records using session method but some records are missing.In error log i got some errors.then now how can i update the error records.You haven't provided much information. What transaction? What upload method? Custom program or standard? You either need to process the transactions in foreground or errors only mode to fix them OR you need to fix the errors at the source and re-run them. A good developer always programs for errors and reprocessing with prevention of duplicates, so that you could run the entire file again without issue. Did you tag the records/documents with an identifier to prevent duplicates?
-
Error while uploading the data Using LSMW - Idoc method
Hi Experts,
I am working on LSMW using Idoc method. Till 12th step (Display converted data) i wasn't got any problem. For the Idoc method, I have to specify details to Idoc inbound processing from the menu settings.
In that screen I have to specify file port, partner type and partner no. I have created a file port ZFILE. Can u tell me what ahould I pass in that screen? Where should be the file i.e in the application server or presentation server? What should be the directory and function module. Can u provide step by step?
After that I have to specify partn.type. What should I select for that?
After that I have to specify partner no. Whether it is inbound or outbound?
I got No data found for the following detials.
port - ZFILE
in the inbound file tab, e:\ as physical directory; EDI_PATH_CREATE_USERNAME as function module.
Partner type - US
Parnter no. - LSMW with the inbound parameters message type - MATMAS and Process code - MATM.
Please tell me how can I upload properly? Please don't ignore as i am asking same question again becasue I have gone through related threads also. But i didn't find the exact requirement.
proper documentation will be rewarded.
Thanks in Advance.
James.Hello,
I could identify the error. It was due to incorrect UOM. Problem resolved.
Thanks,
Madhura -
How to upload mm02 data using bapi
Hi guru,
i want to upload data in mm02.my text file is like
material no, language and description.
711 AR A12345
711 BG A12345
711 CA A12345
321 AR F12345
321 BG F12345
321 CA F12345
i wrote a code like
loop at itab into wa_ITAB.
WA_HEADDATA-MATERIAL = wa_itab-matnr."Pass Material No here
IT_MATERIALDESCRIPTION-MATL_DESC = wa_itab-MAKTX."Pass Material Description here
IT_MATERIALDESCRIPTION-LANGU = WA_ITAB-SPRAS."Language here
CLEAR: WA_ITAB.
APPEND IT_MATERIALDESCRIPTION.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = WA_HEADDATA
IMPORTING
RETURN = RETURN
TABLES
MATERIALDESCRIPTION = IT_MATERIALDESCRIPTION.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
write:/ return-TYPE.
endloop.
but data can not upload is it right or wrong?You should also only call the update once for each material instead of trying to update the material 1 language at a time.
loop at itab into wa_ITAB.
at new matnr.
WA_HEADDATA-MATERIAL = wa_itab-matnr."Pass Material No here
WA_HEADDATA-BASIC_VIEW = 'X'.
clear it_materialdescription[].
endat.
IT_MATERIALDESCRIPTION-MATL_DESC = wa_itab-MAKTX."Pass Material Description here
IT_MATERIALDESCRIPTION-LANGU = WA_ITAB-SPRAS."Language here
APPEND IT_MATERIALDESCRIPTION.
at end of matnr.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = WA_HEADDATA
IMPORTING
RETURN = RETURN
TABLES
MATERIALDESCRIPTION = IT_MATERIALDESCRIPTION.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
endat.
endloop.
Edited by: Larry Browning on Nov 15, 2010 1:45 PM
Edited by: Larry Browning on Nov 15, 2010 1:47 PM -
Uploading the Data into BDC using Excel sheet
HI Gurus,
Iam uploading the Data Using Excel sheet.TCode:qp01.
Upto 3 screens the data is passing in a very fine manner.
From the fourth screen I'v to enter the Lineitem for a single material.
Ex: Matnr is PJBRIX.
For this material upto 3 screens the data is same ,but from the line item data,the PJBRIX has 3 characterstics.
How can I upload that data.
Structure:
Matnr Group GroupCounter MicCode Method Lower Upper
Pjbrix 5 6 zsr001 zsr001 1 15
Pjbrix 5 6 zsr002 zsr003 4 20
Pjbrix 5 6 zsr006 zsr0018 2 18
This is the Structure.
Pls gv me the advise or Gv me the code asap.
thanks in advance.HI Gurus,
Iam uploading the Data Using Excel sheet.TCode:qp01.
Upto 3 screens the data is passing in a very fine manner.
From the fourth screen I'v to enter the Lineitem for a single material.
Ex: Matnr is PJBRIX.
For this material upto 3 screens the data is same ,but from the line item data,the PJBRIX has 3 characterstics.
How can I upload that data.
Structure:
Matnr Group GroupCounter MicCode Method Lower Upper
Pjbrix 5 6 zsr001 zsr001 1 15
Pjbrix 5 6 zsr002 zsr003 4 20
Pjbrix 5 6 zsr006 zsr0018 2 18
This is the Structure.
Pls gv me the advise or Gv me the code asap.
thanks in advance. -
I am unable to upload the customer master data using BAPI.?
Hi Guru's,
i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1)
Please guide me how upload the data...
Thanks in iadvance
Srinivas...Hello Srinivas
This BAPI does not allow to create a new customer from scratch but only to copy an existing customer to a new one and change its address data.
The reference customer has to be provided using IMPORTING parameter PI_COPYREFERENCE. See also the BAPI documentation for more details.
The BAPI does the same like transaction XD01 with Reference.
Regards
Uwe -
Upload the data for sales order using BAPI
hi experts,
how to upload the data for sales order using BAPI.
what is the FM?
it would be much helpful if i have the sample code as i am very new to BAPI.
thanks and Regards
ShyamHi Shyam
Its very useful for u
BAPISDORDER_GETDETAILEDLIST
BAPI_ACC_SALES_ORDER_CHECK
BAPI_ACC_SALES_ORDER_POST
BAPI_ACC_SALES_QUOTA_CHECK
BAPI_ACC_SALES_QUOTA_POST
Reward all the helpful answers..
With Regards
Navin Khedikar -
How to upload the data to 'abzu' transaction using bapi
Hi Experts ,
I need to upload the data to the (asset write up ) transaction 'abzu' and please help me inthis regard
i found some bapi's like below
BAPI_FIXEDASSET_CHANGE Changes an Asset
BAPI_FIXEDASSET_CREATE Creates an Asset
BAPI_FIXEDASSET_CREATE1 Creates an Asset
BAPI_FIXEDASSET_GETDETAIL Display Detailed Information on a Fixed Asset
BAPI_FIXEDASSET_GETLIST Information on Selected Assets
BAPI_FIXEDASSET_OVRTAKE_CREATE BAPI for Legacy Data Transfer
BAPI_FIXEDASSET_TEST BAPI for Legacy Data Transfer
i tried with this bapies but unable to do the transfer the data ,
please help me ,
which is the exactly suitable bapi for uploading the data to 'abzu' transaction
i apriciate you advanced ,
please give me the exactly solution for this ,
Regards.,Hi Experts ,
I need to upload the data to the (asset write up ) transaction 'abzu' and please help me inthis regard
i found some bapi's like below
BAPI_FIXEDASSET_CHANGE Changes an Asset
BAPI_FIXEDASSET_CREATE Creates an Asset
BAPI_FIXEDASSET_CREATE1 Creates an Asset
BAPI_FIXEDASSET_GETDETAIL Display Detailed Information on a Fixed Asset
BAPI_FIXEDASSET_GETLIST Information on Selected Assets
BAPI_FIXEDASSET_OVRTAKE_CREATE BAPI for Legacy Data Transfer
BAPI_FIXEDASSET_TEST BAPI for Legacy Data Transfer
i tried with this bapies but unable to do the transfer the data ,
please help me ,
which is the exactly suitable bapi for uploading the data to 'abzu' transaction
i apriciate you advanced ,
please give me the exactly solution for this ,
Regards., -
For transaction code MD61, I want to upload data using BAPI
Hi,
for transaction code MD61, I want to upload data using BAPI.
Which BAPi I ll call ?
Can anyone suggest me how to do it with any simple example program ?Refer the thread for details about coding-
BAPI_REQUIREMENTS_CREATE
Reards,
Amit -
Transaction code used to upload the data in the application server SCM syst
Hi
Could you please anyone tell me the transaction code which has been used to upload the data into the application server in SCM ( APO) system from presentation server.
For ex : R/3 system CG3Y , CG3Z has been used to upload the data into application server similarly way could you please tell me the transaction code is used in the APO system for uploading the data into application server.
Thanks advance for your support.
Regards,
Kirantry tcode SXDA_TOOLS - copy
(1st you must fill all obligatory fields)
A. -
How to upload a data using BAPI_SALESORDER_CREATEFROMDAT2 without using LSM
Hi,
I want to upload a data from an input file on the presentation server using BAPI_SALESORDER_CREATEFROMDAT2 first uploading the data and then creating sales orders out of it.
I will be highly obliged if anyone can guide me with it.
I have tried the same using LSMW got succeeded in posting the idocs correctly and now I want to do it without using LSMW. The main intention of not using LSMW is that after creating sales orders, I want to display the messages related to number of sales order created, Number of records uploaded, Number of records.Hi
BAPI_SALESORDER_CREATEFROMDAT2
Text
Sales order: Create Sales Order
Functionality
You can use this method to create sales orders.
You must enter at least sales order header data (via ORDER_HEADER_IN structure) and partner data (via the ORDER_PARTNERS table) as input parameters.
Enter the item data via the ORDER_ITEMS_IN table. You can allocate item numbers manually, by filling in the relevant fields, or the system does it, according to the settings for Customizing, by leaving the relevant fields blank.
If you have configurable items, you must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.
Credit cards can be transferred via the BAPICCARD structure, on the one hand, data for card identification, on the other, data for a transaction which has taken place in an external system.
Once you have created the sales order successfully, you will receive the document number (SALESDOCUMENT field). Any errors that may occur will be announced via the RETURN parameter.
If no sales area has been created in the sales order header, then the system creates the sales area from the sold-to party or ship-to party, who has been entered in the partner table. If a clear sales area cannot be created, you will receive a system message, and the sales order will not be created.
Notes
1. Mandatory entries:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
2. Ship-to party:
If no ship-to party is entered, use the following: Ship-to party =
sold-to party.
3. Commit control:
The BAPI does not have a database commit. This means that the relevant application must leave the commit, in order that can be carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is available for this.
4. German key words:
The following key words must be entered in German, independantly of
the logon language:
DOC_TYPE Sales document type, for example: TA for standard order
PARTN_ROLE Partner role, for example: WE for ship-to party
Further Information
You can find further information in the OSS. The note 93091 contains general information on the BAPIs in SD.
Parameters
SALESDOCUMENTIN
ORDER_HEADER_IN
ORDER_HEADER_INX
SENDER
BINARY_RELATIONSHIPTYPE
INT_NUMBER_ASSIGNMENT
BEHAVE_WHEN_ERROR
LOGIC_SWITCH
TESTRUN
CONVERT
SALESDOCUMENT
RETURN
ORDER_ITEMS_IN
ORDER_ITEMS_INX
ORDER_PARTNERS
ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX
ORDER_CFGS_REF
ORDER_CFGS_INST
ORDER_CFGS_PART_OF
ORDER_CFGS_VALUE
ORDER_CFGS_BLOB
ORDER_CFGS_VK
ORDER_CFGS_REFINST
ORDER_CCARD
ORDER_TEXT
ORDER_KEYS
EXTENSIONIN
PARTNERADDRESSES
Regards
Raj
Maybe you are looking for
-
Printing to pdf no longer works
A recent "upgrade" of both operating system and Acrobat software now means that trying to do something like print a web page to a pdf document does not work - crashing the primary application {Safari}. This means that there are at least three places
-
I cant use photostream on my IMAC - no problem with the iphone or Ipad. When I login on ICloud, open Iphoto and ask to connect to photostream I am told: " Iphoto could not connect to Photostream" What is wrong ?
-
JDBC issue while calling queries in oracle- urgent
Hi ! Theres a peculiar problem being faced while calling queries(SQL statements having join of more than 2 tables) in oracle database. We are using JDBC thin driver. We are calling SQL statements from stateless session EJBs deployed in weblogic app s
-
Quality is everything!!!
I am trying to capture the BEST quality document for my local print shop to reproduce a newsletter with multiple graphics and photos. Usually, I save to a .pdf, and the resulting quality is not good. Is there a better way to do this with Pages '06? I
-
Impact of the Datasource structure got changed?
Hi all, I am working on CRM as sourcesystem.I have created datasource with Function module.Data has been loading to the cube since one month.The problem is in the structure Tittle1(40) and Tittle(40) length has taken.But it should have to take Tittle