URGENT, bdc uploaded wrong data
Dear all SAP-ABAP consulatants,
i would request you people to kindly help me out from my scenario.
i need to delete records from transaction 'cs02' , where in by validating the field so that it wont delete the existing records.
the fields are matnr,werks,stlan,idnrk,meng,meins,postp
From all d fields above i need to delete the record for field stlan,idnkr meng,meins &postp.
MY BDC ISNT WORKING IN A PROPER MANNER ITS DELETING ALL D RECORDS FOR DIFFERENT MATERIAL NUMBERS.
ths code is
report Z_PP_BOM_DEL_SCRAP
no standard page heading line-size 255.
include bdcrecx1.
start-of-selection.
data:begin of it_data occurs 0,
matnr(18), "Material
idnrk(18), "Component
end of it_data.
Parameters:p_file type IBIPPARMS-PATH.
data:p1_file type string.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
start-of-selection.
p1_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = p1_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '#'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = it_data.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
loop at it_data.
Refresh bdcdata.
perform pro_data.
endloop.
perform close_group.
form pro_data.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
it_data-matnr. "'S_HIFUH2A1A1A1A-02'.
perform bdc_field using 'RC29N-WERKS'
'sm01'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'28.11.2007'.
perform bdc_dynpro using 'SAPLCSDI' '0150'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=SETP'.
perform bdc_dynpro using 'SAPLCSDI' '0708'.
perform bdc_field using 'BDC_OKCODE'
'=CLWI'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-SELID'.
perform bdc_field using 'RC29P-SELID'
'scrap100002'.
perform bdc_dynpro using 'SAPLCSDI' '0150'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-AUSKZ(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCDL'.
perform bdc_field using 'RC29P-AUSKZ(01)'
'X'.
*if sy-subrc <> 0.
perform bdc_dynpro using 'SAPLCSDI' '0150'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
*endif.
perform bdc_transaction using 'CS02'.
endform.
Thanks for the reply sandeep, actually wt happen is by mistake I have uploaded wrong line item for the material in my first BDC so I have to delete those records that is the line items which were entered wrong.
the fieds of the line items are IDNRK,meng, meins & postp.
I am able to delete the records using the program I have posted but the problem is if that particular line item(which I need to delete) is not available in that material the BDC stuck saying the line item not found or else its deleting some other line item which is not right .
so I need some help in writing the logic to this BDC so that it only deletes the required line items and if not found it has to go to the next material.
Thanks for your time and appreciate your help
Similar Messages
-
Bdc upload file data into internal table problem with gui_upload fm
Hello experts,
my coding is like this ..
data : begin of itab occurs 0 .
field1 like mara-matnr,
field2......
etc,
end of itab.
data: file1 type string.
parameter :file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
mask = space
field_name = 'FILE'
CHANGING
file_name = file.
START-OF-SELECTION.
FILE1 = FILE . "HERE I AM PASSING INTO STRING
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILE1
FILETYPE = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
file structure is same as the internal table.
I stored the file as .txt( ie in notepad).
my file is like this..
10000 200 323 sunndarrr.......
i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
when i am using the ws_upload it is working fine.
please guide me where i have done the mistake.
thank you so much for all the replies.Hi,
Have a look on the following code.
TABLES: kna1.
DATA: BEGIN OF itab1 OCCURS 0,
str(255),
END OF itab1.
DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'D:\ABAP EVE\ffile1.txt'
filetype = 'ASC'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE:/ 'sorry'.
ELSE.
LOOP AT itab1.
SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
APPEND itab2.
ENDLOOP.
IF sy-subrc = 0.
LOOP AT itab2.
WRITE:/ itab2-kunnr,itab2-name1.
INSERT INTO kna1 VALUES itab2.
ENDLOOP.
IF sy-subrc = 0.
WRITE:/ 'inserted'.
ELSE.
WRITE:/ 'not inserted'.
ENDIF.
ELSE.
WRITE:/ 'fail'.
ENDIF.
ENDIF.
Flat file:
10001,Sadney
10003,Yogesh
20005,Madan
1.U need to define internal table with one field of max size
2.upload the flat file data into that internal table
3.split that internal table data into another internal table(having fields)
<REMOVED BY MODERATOR>
thanks,
Chandu
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM -
What is the Tcodes for Uploading of data using BDC & CATT
PP members:
I was going through the <b>cutover activities</b> , and what I understood is we transfer all the legacy system data into SAP before going live
The data upload follows certain steps (depends on the organizational design load strategies)
First we upload all the master data ( material master, BOM, W/C's & Routings)
Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
Lastly,. I am not sure about the Tcode of CATT & BDC
Summary of the questions:
1.What does the author mean <b>material of previous stage</b>, for WIP materials during cutover activities
2. Is it mandatory to use only LSMW tool for uploading for master data
3. What are the Tcodes for upload tools CATT & BDC ?
Thanks for your time
Suren RDear,
1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM. -
Problem in the BDC program to upload the data from a flat file.
Hi,
I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
2) Finally after the data is uploaded, following messages need to be displayed:-
a) Total Number of records successfully uploaded.
b) Session Name
c) Number of Sessions created.
Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
Thanks,Here is an example program, if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value. This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
REPORT zrich_0001.
TYPES: BEGIN OF ttab,
rec TYPE string,
END OF ttab.
TYPES: BEGIN OF tdat,
fld1(10) TYPE c,
fld2(10) TYPE c,
fld3(10) TYPE c,
fld4(10) TYPE c,
END OF tdat.
DATA: itab TYPE TABLE OF ttab.
data: xtab like line of itab.
DATA: idat TYPE TABLE OF tdat.
data: xdat like line of idat.
DATA: file_str TYPE string.
DATA: delimitor TYPE string.
PARAMETERS: p_file TYPE localfile.
PARAMETERS: p_del(5) TYPE c.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
DATA: ifiletab TYPE filetable.
DATA: xfiletab LIKE LINE OF ifiletab.
DATA: rc TYPE i.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = ifiletab
rc = rc.
READ TABLE ifiletab INTO xfiletab INDEX 1.
IF sy-subrc = 0.
p_file = xfiletab-filename.
ENDIF.
START-OF-SELECTION.
TRANSLATE p_del TO UPPER CASE.
CASE p_del.
WHEN 'TAB'.
delimitor = cl_abap_char_utilities=>horizontal_tab.
WHEN others.
delimitor = p_del.
ENDCASE.
file_str = p_file.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = file_str
CHANGING
data_tab = itab.
LOOP AT itab into xtab.
CLEAR xdat.
SPLIT xtab-rec AT delimitor INTO xdat-fld1
xdat-fld2
xdat-fld3
xdat-fld4.
APPEND xdat to idat.
ENDLOOP.
LOOP AT idat into xdat.
WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
ENDLOOP.
Regards,
Rich Heilman -
hi hr gurus,
plz help
we have 3 shifts like 6-2,2-10,10-6.
while uploading time data to sap from third party system.
do we need to take care of the shifts times in BDC?
or do we need to manage it in configurations
if you have any code please send me
regardsHi,
As above said was the also procedure to do the BDC recording.Hope you understand the precedure in detail else have a look @ this.
1.Goto transaction shdb for recording.
2.There give the recording name starting with Z or Y letter.
3.Click "New Recording" button in the left extreme Application tool bar.
4.You will get a new pop up window Create Recording there give Recording Name"Z r Y" and give the transaction code that you going to record for e.g (PA30,XK01).
5.Leave the Mode as it is and click "Start Recording".
6.Here you will get the transaction code window for e.g if you are giving PA30 it will call the corresponding transaction.
7.Start recording by entering the values which you want to record.
8.After recording save the recording and give back.
9.There you find the list of process which is done.
10.Enter your recording name and press enter you will get the program name.
11.Select the program name and press "program" button in the application tool bar.It will ask abt the prgm name and give read from file.
12.You will get the coding in se38 for recording.
13.Edit your program for uploading the flat file from you legacy system to application server by using CALL FUNCTION "GUI_UPLOAD".
14.Get the flat file and fill it in internal table and pass the internal table values by giving "loop at internal table" after READ DATASET statement.
15.Select the call transaction for small no. of data for large no. of data we have to use session method.(Refer some links for difference between session and call transaction).
16.There by executing the program we will get the output which record are created.
Thanks,
Sakthi.C
*Rewards if usefull--* -
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. -
Problem in Uploading Excel Data ! - Urgent
Dear Experts,
I am uploading excel data using FM 'TEXT_CONVERT_XLS_TO_SAP' , its directly convert data and store in internal table same as in excel sheet(row , column wise).
But the problem is , one of the column having description more then 500 characters. so while uploding excel to itab its truncating the text and only uploding 255 characters.
Is there any other way , so that i can upload more then 500 characters long text. Also i have tried 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM , it was also not working.
Please Help me , its Urgent.
Points will be rewared.
Thanks & Regards,Hi,
Please use FM 'GUI_UPLOAD'.
types: begin of ttab,
rec(1000) type c,
end of ttab.
types: begin of tdat,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
end of tdat.
data: itab type table of ttab with header line.
data: idat type table of tdat with header line.
data: file_str type string.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
file_str = p_file.
call function 'GUI_UPLOAD'
exporting
filename = file_str
filetype = 'ASC'
tables
data_tab = itab
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.
Best regards,
Prashant -
Uploading photos from PC to Photo library results in wrong date/time
Uploading photos to iCloud photo library using icloud.com will result in wrong date/time of the photos, which is, to be precise, 15 hours later than the actual time in EXIF. Thanks in advance.
iTunes is not a photo management program, never has been.
Delete the pictures (or remove them from the folder that syncs). This has absolutely nothing to do with iTunes.
If the Photo tab is not displaying in iTunes, resize the window. -
How we can upload the data through BDC for transaction J1ID
Hi guru
How w can upload the data for Transaction J1ID.In this we want to upload the data for Customer Excise details. I want to upload the data on behalf of Customer (KUNNR) becasue customer is a primary KEY. Table name: J_1IMOCUST
Fields. 11 Fields.plz provide some code logic.
KUNNR J_1IEXCD J_1IEXRN J_1IEXRG J_1IEXDI J_1IEXCO J_1ICSTNO J_1ILSTNO J_1IPANNO J_1IEXCICU J_1ISERNHi,
I dont see any difficulties in doing BDC upload for J1ID, You have to record by giving the New Entries button and then enter all the details of customers using table control technique.
SEARCH SCN for Table Control in BDC
Regards
Karthik D -
Upload Applicant Data thru BDC
Hi,
Can I upload Applicant Data Through BDC.
SamriddhiBDC is the program it behave what the way you write.
You have to write code as per your need.
For that you have to record in which way it will do action in genral process
Please ask your abaper to do recording once again
Regards -
" Thread in Bdc in uploading the data "
My scenario is to upload the data from the t-code WG21 . I HAVE WRITTEN A BDC PROGRAMME , HALF OF THE DATA IS UPLOADED , REMAINING DATA IS NOT UPLOADED . I AM GETTING THE ERROR MESSAGE AS FUNCTION CODE IS REQUIRED .
I AM SENDING MY BDC CODE AS AN EXAMPLE . CAN ANYBODY HELP ME IN SOLVING THE ISSUE.
report ZMC
no standard page heading line-size 255.
*include bdcrecx1.
INTERNAL TABLE DECLARATION ******
DATA : BEGIN OF ITAB OCCURS 0 ,
MATKL(9) TYPE C,
WGBEZ(20) TYPE C,
CLASS1(18) TYPE C,
WGBEZ60(60) TYPE C,
STATU(1) TYPE C,
MERKMA(1) TYPE C,
RELEV(01) TYPE C,
EINTRAG LIKE RMCLM-EINTRAG,
CLASS2(18) TYPE C,
END OF ITAB.
DATA: ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
**AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
PERFORM GET_FILE.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: file TYPE rlgrap-filename OBLIGATORY,
mode TYPE ctu_params-dismode OBLIGATORY DEFAULT 'A'.
SELECTION-SCREEN : END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
PERFORM GET_FILE.
START-OF-SELECTION.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
LOOP AT ITAB.
perform bdc_dynpro using 'SAPMWWG2' '1000'.
perform bdc_field using 'BDC_CURSOR'
'T023D-MATKL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
perform bdc_dynpro using 'SAPMWWG2' '1100'.
perform bdc_field using 'BDC_CURSOR'
'WWGD-CLASS1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023TD-WGBEZ'
ITAB-WGBEZ. "'non food category'.
perform bdc_field using 'T023TD-WGBEZ60'
ITAB-CLASS1. "'non food category'.
perform bdc_field using 'WWGD-CLASS1'
ITAB-WGBEZ60. "'nonfoods'.
perform bdc_dynpro using 'SAPMWWG2' '1100'.
perform bdc_field using 'BDC_CURSOR'
'T023TD-WGBEZ'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR BDCDATA.
REFRESH BDCDATA.
PERFORM BDC_DYNPRO using 'SAPMWWG2' '1000'.
perform bdc_field using 'BDC_CURSOR'
'T023D-MATKL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
PERform bdc_field using 'T023TD-WGBEZ'
ITAB-WGBEZ. "'non food category'.
perform bdc_field using 'T023TD-WGBEZ60'
ITAB-CLASS1. "'non food category'.
perform bdc_field using 'WWGD-CLASS1'
ITAB-WGBEZ60. "'NONFOODS'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-STATU'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR BDCDATA.
REFRESH BDCDATA.
perform bdc_field using 'RMCLM-STATU'
ITAB-STATU. "'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-RELEV(01)'.
perform bdc_field using 'RMCLM-MERKMA(01)'
ITAB-MERKMA. "'flavor'.
perform bdc_field using 'RMCLM-RELEV(01)'
ITAB-RELEV(01). "'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/EENDE'.
perform bdc_dynpro using 'SAPLSPO1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-EINTRAG'.
perform bdc_field using 'RMCLM-EINTRAG'
ITAB-EINTRAG. "'1'.
perform bdc_dynpro using 'SAPMWWG2' '4000'.
perform bdc_field using 'BDC_CURSOR'
'WWGD-CLASS2'.
perform bdc_field using 'BDC_OKCODE'
'=BANL'.
perform bdc_field using 'T023D-MATKL'
ITAB-MATKL. "'120101114'.
perform bdc_field using 'WWGD-CLASS2'
ITAB-CLASS2. "'CHARAC'.
CALL TRANSACTION 'WG21' USING bdcdata
MODE mode
UPDATE 'S'
MESSAGES INTO messtab.
ENDLOOP.
perform close_group.
*& Form get_file
text
FORM GET_FILE.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'file '
FIELD_NAME = 'file '
STATIC = ' '
MASK = ' '
FILEOPERATION = 'R'
CHANGING
FILE_NAME = file
FILE_NAME = file
LOCATION_FLAG = 'P'
EXCEPTIONS
MASK_TOO_LONG = 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. "GET_FILE
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELDHi,
Please post the question in the appropriate forum to get faster response.
-Vikram -
Upload external cap file: jcshell: Error code: 6a80 (Wrong data)?
Hi,
i use eclipse + NXP JCOP Plugins_Generic3.2.8_Target ,the card is jcop31v232.
if the cap file is generated by eclipse project , when i upload exteral cap file ,no error
but if the cap file is generated by converter command ,there is error
what error?help me
cm> /terminal "winscard:4|Feitian R502 Contact Reader 1"
--Opening terminal
/card -a a000000003000000 -c com.ibm.jc.CardManager
resetCard with timeout: 0 (ms)
--Waiting for card...
ATR=3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 33 31 56 ;.....1.EJCOP31V
32 33 32 93 232.
IOCTL().
ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP31V232"> => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
(104154 usec)
<= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 oe...........Y.e
01 FF 9F 6E 06 47 91 73 51 2E 00 73 4A 06 07 2A ...n.G.sQ..sJ..*
86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B .H..k.`...*.H..k
02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 ....c...*.H..k.d
0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09 ...*.H..k...e...
2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 +...Hd...f...+..
04 01 2A 02 6E 01 02 90 00 ..*.n....
Status: No Error
cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
cm> init-update 255
=> 80 50 00 00 08 A7 C7 04 88 8C 87 3F DE 00 .P.........?..
(68417 usec)
<= 00 00 93 36 01 29 05 95 13 05 FF 02 00 5F E1 48 ...6.)......._.H
67 60 FD 2F 89 FF AD A4 72 B4 17 E9 90 00 g`./....r.....
Status: No Error
cm> ext-auth plain
=> 84 82 00 00 10 17 6D 1C 2A 87 9E 0A 24 3F 15 83 ......m.*...$?..
A4 84 10 C0 75 ....u
(71713 usec)
<= 90 00 ..
Status: No Errorh1.
cm> upload -d "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
=> 80 E6 02 00 12 05 A0 00 01 00 62 08 A0 00 00 00 ..........b.....
03 00 00 00 00 00 00 00 ........
(56499 usec)
<= 00 90 00 ...
Status: No Error
=> 80 E8 00 00 FF C4 82 01 A1 01 00 0F DE CA FF ED ................
01 02 04 00 01 05 A0 00 01 00 62 02 00 1F 00 0F ..........b.....
00 1F 00 0B 00 15 00 2E 00 0C 00 63 00 17 00 12 ...........c....
00 00 00 6F 00 02 00 01 00 0A 02 01 00 04 00 15 ...o............
02 03 01 07 A0 00 00 00 62 01 01 00 01 07 A0 00 ........b.......
00 00 62 00 01 03 00 0B 01 07 A0 00 01 00 62 03 ..b...........b.> 01 00 08 06 00 0C 00 80 03 00 FF 00 07 01 00 00 ................
> 00 1C 07 00 63 00 01 10 18 8C 00 00 7A 05 30 8F ....c.......z.0.
> 00 01 3D 8C 00 02 18 1D 04 41 18 1D 25 8B 00 03 ..=......A..%...
> 7A 02 21 18 8B 00 04 60 03 7A 19 8B 00 05 2D 1A z.!....`.z....-.
> 04 25 75 00 10 00 01 00 30 00 09 18 19 8C 00 06 .%u.....0.......
> 70 08 11 6D 00 8D 00 07 7A 05 21 19 8B 00 05 2D p..m....z.!....-
> 7B 00 08 03 1A 03 7B 00 08 92 8D 00 09 3B 19 03 {.....{......;..
7B 00 08 92 8B 00 0A 7A 08 00 17 00 02 00 01 00 {......z........
01 03 00 0A 48 65 6C 6C 6F 57 6F 72 6C 64 00 00 ....HelloWorld..> 00 00 05 00 2E 00 0B 06 80 03 00 01 00 00 00 06 ................
> 00 00 01 03 00 .....
>(1200 msec)
<= 6A 80 j.
Status: Wrong data
jcshell: Error code: 6a80 (Wrong data)
jcshell: Wrong response APDU: 6A80thank you. I use jcdk 2.2.1,jcop31v232 supports jc2.2.1 and gp2.1.1
And i can not understand this:
your jcop card is not a javacard v3 card.
cm> /cap-info -p "D:\JCIDE_workspace\hello\hello\javacard\hello\hello" "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
jcshell: Cannot read file <D:\JCIDE_workspace\hello\hello\javacard\hello.cap>: Incomplete CAP file, missing mandatory component: Header.capbut there is Header.cap in hello.cap:
hello/javacard/Header.cap :
01 00 13 de ca ff ed 01 02 04 00 01 09 a0 00 01
00 62 03 01 0c 02 -
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. -
Error occured while uploading the data for Tocde QP01 (BDC)
Hi,
I am facing a strange problem i.e. when i try to upload the data for the Tcode QP01 i am able to upload the data for the 18 rows but when it is more than 18 ,it gives the following error and saves the data upto 18 rows only :-
CALL_TRANSACTION QP01 returncode: 0 RECORD: 0
S Field RC27X-FLG_SEL . not found in loop of screen SAPLCPDI 1400
S Cursor field PLMKB-VERWMERKM (18) does not exist in the screen
S Field PLMKB-VERWMERKM (18) does not exist in the screen SAPLQPAA 0150
S Field PLMKB-STICHPRVER (18) does not exist in the screen SAPLQPAA 0150
S Inspection plan with plan group 12775 for material 200999 is saved
Is there any way to solve this problem...hi,
Ok,i agree with you but the thing is it was allowing to upload the data for more than 18 rows as there was logic written. It is specified in the code:-
ELSEIF itab1-serial > 18 AND itab1-serial < 35.
IF index = 19.
index = 2.
ENDIF.
Edited by: nav009 on Sep 9, 2009 8:25 AM -
Urgent BEX Report Showing the Wrong data
Hi Experts,
In my Cube the data is available curreclty, but where as my bex report showing the wrong data.
like xeample:
Infocube
Material Plant Year Units Qty
000000000002001032 003 2006 BAG 1,500
But in bex i took the same selection's, but it displays as
000000000002001032 003 2006 BAG 2
i am Unable to trace this
any help plzzz
AnilHi,
since Quantity(units PC??) can not be in decimals,Bex will round off 1.5 to 2 in bex report.
Use NODIM function i.e. NODIM(Qty) instead of Quantity.
NODIM function is available under data functions of Formula builder.
From context menu fo KF structure>new formula>NODIM(Qty).
or
try by setting Decimal places to 2 or 3 in KF properties in Bex Query.
hope this helps.
Message was edited by: Murali
Maybe you are looking for
-
Depot sto excise invoice cancallation
dear sir I have do the STO for plant to depot steps 1) sto po created 2) delivery created in vl10b 3) PGI in vl02n 4)per-form invoice in vf01 5) excise invoice in J1iin 6) goods recipts and excise posting done in depot plant MIGO 7)J1IDEPOTSTOCK1 - D
-
Can I install Virtual Box on my macbook pro safely if filevault is enabled? Lion w 8 g memory.
-
2009 iMac 24" GeForce 120 problems after 10.6.7 upgrade
Hi all, I've read a lot of threads about iMac graphic problems on these boards, but I haven't really found anything here that sounds like my problem. Several weeks ago, I upgraded my early 2009 iMac to 10.6.7. Up until this point, I have had zero pro
-
Wi-fi freezes after Hard Reset
I hard reset my Palm TX and then did a Hot Sync. When I tried to connect to Wi-fi or switch radio on the screen goes white and freezes. I did another Hard Reset without Hot Syncing afterwards and tried again with the same result. Do I have a hardw
-
A Few Questions/Problems With My New iPod *PLEASE HELP*
Hello! I just received my first iPod (4th Gen, 4GB, Red Nano) two days ago (Christmas Eve) and have so far been fairly happy with it. However, I'm experiencing a few problems with it and am hoping that someone could help me. Firstly, a few of the alb