Bdc recording for mm01
hi all,
this is an extract of materail master upload for mm01 when i execute this recording purchase order text view doesnot get populated with text. anybody can tell me whts wrong with this?????
perform bdc_field using 'MAKT-MAKTX'
'carr'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(05)'.
perform bdc_field using 'BDC_OKCODE'
'=TXVB'.
perform bdc_field using 'RSTXT-TXLINE(02)'
'qqqqqqqqqqqqqq ssssssssssssssssssssss'
& 'sssss.00000000000000jjjjjjjjjjjjoo'.
perform bdc_field using 'RSTXT-TXLINE(03)'
'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww jjjjjj'
& 'jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj'.
perform bdc_field using 'RSTXT-TXLINE(04)'
'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'
& 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'.
perform bdc_field using 'RSTXT-TXLINE(05)'
'66666666666666666666666666666666666666'
& '6666666666666666666666666666666666'.
perform bdc_dynpro using 'SAPLSTXX' '1100'.
perform bdc_field using 'BDC_CURSOR'
'RSTXT-TXLINE(06)'.
perform bdc_field using 'BDC_OKCODE'
'=TXBA'.
perform bdc_dynpro using 'SAPLMGMM' '4040'.
perform bdc_field using 'BDC_OKCODE'
'=SP12'.
perform bdc_field using 'MAKT-MAKTX'
'carr'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
Hi
You have to upload the Texts using the CREATE_TEXT fun module
see the sample program
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
Regards
Anji
Similar Messages
-
BDC RECORDING FOR MM01 PROBLEM
Hi Experts ,
I did recording using SHDB for TC MM01. I selected Purchase order text as one of the view but after saving my recording I not able to find the text I have entered.
Please help.while recording
if the view is selected
and the text is not getting displayed its because of control tecnoogy being used in enjoy transactions so u cant record if u see there will be a choose button in purchase order text view
click that it will take u to sap script editor where u can enter text -
Hi All,,
Please give Entire BDC code for MM01 Transaction.
i will change as per my requirement.
I think this is already done by some ABAP Consultants.
plz dont give answers like do recording for that transaction MM01. I know recording...
For time constraiint, I have to complete soon.....
Thanks in Advance
BestRegards,
AnilHi,
The below code is using the Session Method
report ZDS_BDC_MM01
no standard page heading line-size 255.
include bdcrecx1.
*parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record OCCURS 0,
* data element: MATNR
MATNR_001(018),
* data element: MBRSH
MBRSH_002(001),
* data element: MTART
MTART_003(004),
* data element: XFELD
KZSEL_01_004(001),
* data element: XFELD
KZSEL_02_005(001),
* data element: MAKTX
MAKTX_006(040),
* data element: MEINS
MEINS_007(003),
* data element: MAKTX
MAKTX_008(040),
end of record.
*** End generated data section ***
start-of-selection.
*perform open_dataset using dataset.
perform open_group.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME ='C:\DHRUV.TXT'
FILETYPE = 'DAT'
* 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 = RECORD
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.
*do.
LOOP AT record.
*read dataset dataset into record.
if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_field using 'RMMG1-MBRSH'
record-MBRSH_002.
perform bdc_field using 'RMMG1-MTART'
record-MTART_003.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
record-KZSEL_01_004.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
record-KZSEL_02_005.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX_006.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
record-MEINS_007.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX_008.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
*enddo.
ENDLOOP.
perform close_group.
*perform close_dataset using dataset.
*Text elements
* E00 Error opening dataset, return code:
* I01 Session name
* I02 Open session
* I03 Insert transaction
* I04 Close Session
* I05 Return code =
* I06 Error session created
* S01 Session name
* S02 User
* S03 Keep session
* S04 Lock date
* S05 Processing Mode
* S06 Update Mode
* S07 Generate session
* S08 Call transaction
* S09 Error sessn
* S10 Nodata indicator
* S11 Short log
*Messages
* Message class: MS
*613 Please enter a session name and user name
The Below is the coding for the Call Transaction...
report ZDS_BDC_MM01_2
no standard page heading line-size 255.
*include bdcrecx1.
*parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record OCCURS 0,
* data element: MATNR
MATNR_001(018),
* data element: MBRSH
MBRSH_002(001),
* data element: MTART
MTART_003(004),
* data element: XFELD
KZSEL_01_004(001),
* data element: MAKTX
MAKTX_005(040),
* data element: MEINS
MEINS_006(003),
* data element: MTPOS_MARA
MTPOS_MARA_007(004),
end of record.
DATA: FLNAME TYPE STRING.
*** End generated data section ***
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*** MESSAGE******
DATA: BEGIN OF MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: MATNR TYPE MARA-MATNR,
END OF MESSTAB.
****END OF MESSAGE****
PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = FILENAME.
start-of-selection.
*perform open_dataset using dataset.
perform open_group.
FLNAME = FILENAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FLNAME
FILETYPE = 'DAT'
* 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 = record
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.
LOOP AT record.
DATA:
CNT TYPE I.
CNT = CNT + 1.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_field using 'RMMG1-MBRSH'
record-MBRSH_002.
perform bdc_field using 'RMMG1-MTART'
record-MTART_003.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
record-KZSEL_01_004.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX_005.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
record-MEINS_006.
perform bdc_field using 'MARA-MTPOS_MARA'
record-MTPOS_MARA_007.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'MM01'.
CALL TRANSACTION 'MM01' USING BDCDATA
MODE 'N'
UPDATE 'A'
MESSAGES INTO MESSTAB.
READ TABLE MESSTAB INTO MESSTAB INDEX CNT.
IF MESSTAB-MSGTYP = 'E'.
MESSTAB-MATNR = RECORD-MATNR_001.
MODIFY MESSTAB INDEX CNT FROM MESSTAB. " TRANSPORTING MATNR.
ENDIF.
ENDLOOP.
FORM OPEN_GROUP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING CLIENT = SY-MANDT
GROUP = 'MM01'
USER = SY-UNAME
KEEP = 'X'.
ENDFORM.
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 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.
ENDFORM.
END-OF-SELECTION.
LOOP AT MESSTAB.
IF MESSTAB-MSGTYP = 'E'.
WRITE:/ 'ERROR OCCURED ON MATNR = ',MESSTAB-MATNR , 'MESSAGE : MATNR ALREADY EXISTS IN MARA!!!'.
ENDIF.
ENDLOOP.
perform close_group.
*perform close_dataset using dataset.
*& Form close_group
* text
* --> p1 text
* <-- p2 text
FORM close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " close_group
*& Form bdc_dynpro
* text
* -->P_0270 text
* -->P_0271 text
FORM bdc_dynpro USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. " bdc_dynpro
*& Form bdc_field
* text
* -->P_0275 text
* -->P_0276 text
FORM bdc_field USING FNAM FVAL.
IF FVAL <> ' '.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. " bdc_field
*Text elements
* E00 Error opening dataset, return code:
* I01 Session name
* I02 Open session
* I03 Insert transaction
* I04 Close Session
* I05 Return code =
* I06 Error session created
* S01 Session name
* S02 User
* S03 Keep session
* S04 Lock date
* S05 Processing Mode
* S06 Update Mode
* S07 Generate session
* S08 Call transaction
* S09 Error sessn
* S10 Nodata indicator
* S11 Short log
HTH
Regards,
Dhruv Shah -
BDC recording for s_alr_87012090
Hi Friends,
My requirement :
As we do vendor changes in xk02, the critical data like bank details, name and address are to be confirmed. so my client want, the changes done in address should not got to confirmation, so I want to do BDC recording for S_ALR_87012090 ( confir vendor changes ). and will check if only address changes are done then i will run these BDC recording .
but i am unable to do recording.
please help me out.
regards
Kumar MHello Kumar M,
What is the issue with it? Why cant you do the recording?
BR,
Suhas -
Bdc recording for XK02 to change vendor address
Dear All,
I am trying to create a bdc recording for XK02 transaction to change Address fields ( Name1 ... Name4 , House num1, street , House number supplement , city , State , Postal code etc .)
When i open the transaction XK02 by clicking address, I see all the above fields.
But when i try to create a recording for the same XK02 transaction through SM35, I see House no & Street as one field and House number supplement missing.
Please let me know how can i update House num1 , Street and House num supplement seperately.
Thanks,
HimaPlease chekc you entry in Country & Region.
The region should belong to the country.
Regards
Bhavesh MIstry -
hi
i have been asked to do bdc recording for the transaction mek1 through the call transaction method.can u people plss tell me how to go abt it?Hi,
You can Record using the Tcode SHDB and format the program and use.
You can use VK11 tcode also which is similar to MEK1.
see the sample code for VK11 ; You can change as per your requirement.
report ZSDBDCP_PRICING no standard page heading
line-size 255.
Includes
include zbdcrecx1.
Internal Tables
*--Internal Table To hold condition records data from flat file.
Data: begin of it_pricing occurs 0,
key(4),
f1(4),
f2(4),
f3(2),
f4(18),
f5(16),
end of it_pricing.
*--Internal Table To hold condition records header .
data : begin of it_header occurs 0,
key(4),
f1(4),
f2(4),
f3(2),
end of it_header.
*--Internal Table To hold condition records details .
data : begin of it_details occurs 0,
key(4),
f4(18),
f5(16),
end of it_details.
data : v_sno(2),
v_rows type i,
v_fname(40).
start-of-selection.
refresh : it_pricing,it_header,it_details.
clear : it_pricing,it_header,it_details.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'C:\WINDOWS\Desktop\pricing.txt'
FILETYPE = 'DAT'
TABLES
DATA_TAB = it_pricing
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.
OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.
if sy-subrc ne 0.
write : / 'File could not be uploaded.. Check file name.'.
stop.
endif.
CLEAR : it_pricing[], it_pricing.
DO.
READ DATASET P_FNAME INTO V_STR.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
write v_str.
translate v_str using '#/'.
SPLIT V_STR AT ',' INTO it_pricing-key
it_pricing-F1 it_pricing-F2 it_pricing-F3
it_pricing-F4 it_pricing-F5 .
APPEND it_pricing.
CLEAR it_pricing.
ENDDO.
IF it_pricing[] IS INITIAL.
WRITE : / 'No data found to upload'.
STOP.
ENDIF.
loop at it_pricing.
At new key.
read table it_pricing index sy-tabix.
move-corresponding it_pricing to it_header.
append it_header.
clear it_header.
endat.
move-corresponding it_pricing to it_details.
append it_details.
clear it_details.
endloop.
perform open_group.
v_rows = sy-srows - 8.
loop at it_header.
perform bdc_dynpro using 'SAPMV13A' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RV13A-KSCHL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RV13A-KSCHL'
it_header-f1.
perform bdc_dynpro using 'SAPMV13A' '1004'.
perform bdc_field using 'BDC_CURSOR'
'KONP-KBETR(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KOMG-VKORG'
it_header-f2.
perform bdc_field using 'KOMG-VTWEG'
it_header-f3.
**Table Control
v_sno = 0.
loop at it_details where key eq it_header-key.
v_sno = v_sno + 1.
clear v_fname.
CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.
perform bdc_field using v_fname
it_details-f4.
clear v_fname.
CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.
perform bdc_field using v_fname
it_details-f5.
if v_sno eq v_rows.
v_sno = 0.
perform bdc_dynpro using 'SAPMV13A' '1004'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_dynpro using 'SAPMV13A' '1004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
endif.
endloop.
*--Save
perform bdc_dynpro using 'SAPMV13A' '1004'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_transaction using 'VK11'.
endloop.
perform close_group.
Regards,
Anji -
Bdc recording for trancastion ME01
Hi,
Can u help me in BDC recording for transaction 'ME01' .
I have no idea for transaction 'ME01' & here i like to know how to handle table ctr during bdc recording?
give sample code if possible.
ThanksSee the sample attached code for ME51 using table control.
similarly record the same for ME01 and copy the TC logic from this.
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
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.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
reward if useful
Regards
Vasu -
BDC recording for transaction 'Me01'
Hi,
Can u help me in BDC recording for transaction 'ME01' .
I have no idea for transaction 'ME01' .
give sample code if possible.
ThanksFor creating source list you will check that purchasing view has been maintained for this material
Source list for resticting, purcasing a material from a specific vendor only for the period specified in source list
Regards,
Amit R. -
Hi,
I am asked to do bdc recording for the transaction sm30 through call transaction method. Can u please tell me how to do that...Hi Buvana,
While recording just mentioned the tcode as SM30 and then it takes you automaticcaly to that transaction code then enter the table name and press maintain tab and then select new entreis. Enter the values then save it. Press back button. Now it will take return to recording section. now u can able to see the recoding section. Generate the program automaticcaly from the recording. Now take neccessary internal tables and complete the code. Reply for any queries and reward for useful points. Take care while recording. Don't mention any wrong values.
Regards,
Kumar. -
BDC Recording for cm07 Transaction
Hi Everyone,
I'm doing BDC recording for CM07 transaction. In Recording, i need to give a print command by specifying the spool title.
For this, after opening the print window, i need to click the 'properties' button, and then select the spool title and input the value.
But I'm unable to do the recording of this print dialog box. The recording ends as soon as I give the print command.
Can anyone please tell me the solution to it.
Thanks and Regards
Rishika bawaHi,
See via transaction SHDB:
SAPLCORU_S 0100 X
BDC_OKCODE BU
AFRUD-RUECK 0000000000
AFRUD-AUFNR 100051152
AFRUD-VORNR 0010
AFRUD-LMNGA 100,000
AFRUD-MEINH PC
AFRUD-XMNGA 2,000
AFRUD-ISM01 200
AFRUD-ILE01 PC
The table for confirmations is AFRU.
Best regards,
Leandro Mengue -
hi all,
how to do bdc recording for AS01.please send me step step by approach.Hi Satya,
Welcome to SDN.
Check this Sample program.
REPORT ZASSET .
INCLUDE ZASSET_INC .
PARAMETERS: P_PCFILE LIKE RLGRAP-FILENAME.
*PARAMETERS: P_FILE_S LIKE RLGRAP-FILENAME.
PARAMETER : H_CHK AS CHECKBOX.
"Proc Mode
Include the BDC *
**BDC DATA STUCTURE
*DATA: BEGIN OF BDCDATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
*DATA: END OF BDCDATA.
messages of call transaction
*DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
TYPE-POOLS
TYPE-POOLS TRUXS.
DATA IT_DATA1 TYPE TRUXS_T_TEXT_DATA.
DATA : BEGIN OF IT_DATA OCCURS 0,
INVZU(015),
ANLKL(008),
BUKRS(004),
TXT50(100),
SERNR(018),
MENGE(018),
INKEN(001),
AKTIV(010),
KOSTL(010),
WERKS(004),
STORT(010),
ORD41(004),
ORD42(004),
EQANZ(001),
LIFNR(010),
AFASL(004),
NDJAR(003),
AFABG(010),
ANLGR(012),
ANLGR2(004),
ANBTR01_01(016),
ANBTR01_06(016),
ANBTR01_16(016),
TDATE(010),
TCODE(004),
TAMT(018),
PERNR(012),
KFZKF(015),
SAP_ASSET(12),
ERR_ASSET,
END OF IT_DATA.
DATA : BEGIN OF IT_DATA2 OCCURS 0,
INVZU(015),
TDATE(010),
TCODE(004),
TAMT(018),
END OF IT_DATA2.
DATA : BEGIN OF IT_DATA3 OCCURS 0,
ITEM(003),
INVZU(015),
ANLKL(010),
BUKRS(010),
TXT50(050),
SERNR(018),
MENGE(018),
INKEN(001),
AKTIV(010),
KOSTL(010),
WERKS(004),
STORT(010),
ORD41(004),
ORD42(004),
EQANZ(001),
LIFNR(010),
AFASL(004),
NDJAR(003),
AFABG(010),
ANLGR(012),
ANLGR2(004),
ANBTR01_01(016),
ANBTR01_06(016),
ANBTR01_16(016),
TDATE(010),
TCODE(004),
TAMT(018),
SAP_ASSET(12),
ERR_ASSET,
END OF IT_DATA3.
SUB ASSET MASTER TABLE
DATA : BEGIN OF IT_DATA_SUB OCCURS 0,
INVZU_M(015),
INVZU(015),
BUKRS(004),
TXT50(100),
ANLHTXT(050),
SERNR(018),
MENGE(018),
MEINS_007(003),
XHIST_008(001),
AKTIV(010),
GSBER_011(004),
KOSTL(010),
STORT(010),
ORD41(004),
ORD42(004),
EQANZ_016(001),
LIFNR(010),
LIEFE(030),
NDJAR(003),
NDPER(003),
ANBTR01_01(016),
ANBTR01_06(016),
ANBTR01_16(016),
BZDAT(010),
BWASL(003),
ANBTR01(016),
ANLN1(012),
ERR_SUB,
SUB_CODE(012),
ERR_SUB1,
END OF IT_DATA_SUB.
*& At selection-screen on value request for getting f4 help
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCFILE.
PERFORM VALUE_REQUEST_P_FILE.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_S.
PERFORM VALUE_REQUEST_P_FILE_S.
START OF SELECTION *
START-OF-SELECTION.
To Upload the flat file datas *
PERFORM GET_DATA.
PERFORM UP_LOAD.
PERFORM SUB_UPLOAD.
WRITE :/ 'FOLLOWING ASSETS CREATED'.
WRITE:/ 'OLD ASSET'.
WRITE: 20 'COMPANY'.
WRITE: 30 'SAP CODE'.
LOOP AT IT_DATA WHERE ERR_ASSET NE 'X'.
WRITE :/ IT_DATA-INVZU,
20 IT_DATA-BUKRS, 30 IT_DATA-SAP_ASSET.
ENDLOOP.
SKIP 2.
WRITE :/ 'FOLLOWING SUB ASSETS CREATED'.
WRITE:/ 'OLD ASSET'.
WRITE: 16 'OLD SUB ASSET'.
WRITE: 35 'COMPANY'.
WRITE: 45 'SAP CODE'.
WRITE: 60 'SUB ASSET'.
LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X' AND ERR_SUB1 NE 'X'.
WRITE :/ IT_DATA_SUB-INVZU_M,
16 IT_DATA_SUB-INVZU,
35 IT_DATA_SUB-BUKRS, 45 IT_DATA_SUB-ANLN1, 60
*IT_DATA_SUB-SUB_CODE.
ENDLOOP.
*& Form value_request_p_file
FORM VALUE_REQUEST_P_FILE .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'x'
IMPORTING
FILE_NAME = P_PCFILE.
ENDFORM. " value_request_p_file
*& Form UP_LOAD
text
--> p1 text
<-- p2 text
FORM UP_LOAD .
SORT IT_DATA BY INVZU.
SORT IT_DATA2 BY INVZU.
DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).
perform open_dataset using dataset.
PERFORM OPEN_GROUP.
LOOP AT IT_DATA.
CONDENSE IT_DATA-TXT50.
V_LEN1 = STRLEN( IT_DATA-TXT50 ).
IF V_LEN1 > 50.
V_SUBSTR1 = IT_DATA-TXT50+0(50).
V_LEN2 = V_LEN1 - 50.
V_SUBSTR2 = IT_DATA-TXT50+50(50).
ELSE.
V_SUBSTR1 = IT_DATA-TXT50.
V_SUBSTR2 = ''..
ENDIF.
REFRESH BDCDATA.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0105'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-BUKRS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'ANLA-ANLKL'
IT_DATA-ANLKL.
PERFORM BDC_FIELD USING 'ANLA-BUKRS'
IT_DATA-BUKRS.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB02'.
PERFORM BDC_FIELD USING 'ANLA-TXT50'
V_SUBSTR1. "IT_DATA-TXT50.
PERFORM BDC_FIELD USING 'ANLA-TXA50'
V_SUBSTR2.
PERFORM BDC_FIELD USING 'ANLA-SERNR'
IT_DATA-SERNR.
PERFORM BDC_FIELD USING 'ANLA-MENGE'
IT_DATA-MENGE.
*perform bdc_field using 'ANLA-INKEN'
record-INKEN_006.
PERFORM BDC_FIELD USING 'ANLA-INVZU'
IT_DATA-INVZU.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-AKTIV'.
PERFORM BDC_FIELD USING 'ANLA-AKTIV'
IT_DATA-AKTIV.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB03'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLZ-PERNR'.
PERFORM BDC_FIELD USING 'ANLZ-PERNR'
IT_DATA-PERNR.
PERFORM BDC_FIELD USING 'ANLZ-KOSTL'
IT_DATA-KOSTL.
PERFORM BDC_FIELD USING 'ANLZ-WERKS'
IT_DATA-WERKS.
PERFORM BDC_FIELD USING 'ANLZ-STORT'
IT_DATA-STORT.
IF IT_DATA-ANLKL = 'VHCL'.
PERFORM BDC_FIELD USING 'ANLZ-KFZKZ'
IT_DATA-KFZKF.
ENDIF.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB04'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ORD42'.
PERFORM BDC_FIELD USING 'ANLA-ORD41'
IT_DATA-ORD41.
PERFORM BDC_FIELD USING 'ANLA-ORD42'
IT_DATA-ORD42.
*perform bdc_field using 'RA02S-EQANZ'
record-EQANZ_014.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB06'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-LIFNR'.
PERFORM BDC_FIELD USING 'ANLA-LIFNR'
IT_DATA-LIFNR.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB08'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLV-VSART'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SELZ'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RA02S-XAKPLA(02)'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLB-AFASL'.
IF IT_DATA-TCODE IS INITIAL.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTD'.
ELSE.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTB'.
ENDIF.
PERFORM BDC_FIELD USING 'ANLB-ANLGR'
IT_DATA-ANLGR.
PERFORM BDC_FIELD USING 'ANLB-ANLGR2'
IT_DATA-ANLGR2.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
IF IT_DATA-TCODE IS INITIAL.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA-ANBTR01_01.
IF H_CHK NE 'X'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
IT_DATA-ANBTR01_06.
ENDIF.
ELSE.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTB'.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
IT_DATA-TDATE.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
IT_DATA-TCODE.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA-TAMT.
ENDIF.
REFRESH MESSTAB.
CALL TRANSACTION 'AS91' USING BDCDATA
MODE H_MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.
PERFORM BDC_TRANSACTION USING 'AS91'.
ENDLOOP..
PERFORM CLOSE_GROUP.
*perform close_dataset using dataset.
ENDFORM. " UP_LOAD
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_TAB_RAW_DATA = IT_DATA1
I_FILENAME = P_PCFILE
TABLES
I_TAB_CONVERTED_DATA = IT_DATA.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IT_DATA3.
IF IT_DATA3-ITEM = '1'.
MOVE-CORRESPONDING IT_DATA3 TO IT_DATA.
APPEND IT_DATA.
ELSEIF IT_DATA3-ITEM = '2'.
IT_DATA2-INVZU = IT_DATA3-INVZU.
IT_DATA2-TDATE = IT_DATA3-ANLKL.
IT_DATA2-TCODE = IT_DATA3-BUKRS.
IT_DATA2-TAMT = IT_DATA3-TXT50.
APPEND IT_DATA2.
ENDIF.
ENDLOOP.
IF NOT P_FILE_S IS INITIAL.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_TAB_RAW_DATA = IT_DATA1
I_FILENAME = P_FILE_S
TABLES
I_TAB_CONVERTED_DATA = IT_DATA_SUB.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " GET_DATA
FORM BDC_DYNPRO
--> PROGRAM
--> DYNPRO
**FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
**ENDFORM. " BDC_DYNPRO
FORM BDC_FIELD
--> FNAM
--> FVAL
**FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
**ENDFORM. "BDC_FIELD
***& Form bdc_transaction
text
-->TCODE text
**FORM BDC_TRANSACTION USING TCODE.
REFRESH MESSTAB.
CALL TRANSACTION TCODE USING BDCDATA
MODE H_MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.
**ENDFORM. " bdc_transaction
*& Form VALUE_REQUEST_P_FILE_S
text
--> p1 text
<-- p2 text
FORM VALUE_REQUEST_P_FILE_S .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'x'
IMPORTING
FILE_NAME = P_FILE_S.
ENDFORM. " VALUE_REQUEST_P_FILE_S
*& Form sUB_upload
text
--> p1 text
<-- p2 text
***FORM SUB_UPLOAD .
DATA : V_LEN1 TYPE I, V_LEN2 TYPE I, V_SUBSTR1(50) ,V_SUBSTR2(50).
LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.
CONDENSE IT_DATA_SUB-TXT50.
V_LEN1 = STRLEN( IT_DATA_SUB-TXT50 ).
IF V_LEN1 > 50.
V_SUBSTR1 = IT_DATA_SUB-TXT50+0(50).
V_LEN2 = V_LEN1 - 50.
V_SUBSTR2 = IT_DATA_SUB-TXT50+50(50).
ELSE.
V_SUBSTR1 = IT_DATA_SUB-TXT50.
V_SUBSTR2 = ''..
ENDIF.
REFRESH BDCDATA.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=MAST'.
PERFORM BDC_FIELD USING 'ANLA-ANLN1'
IT_DATA_SUB-ANLN1.
PERFORM BDC_FIELD USING 'ANLA-BUKRS'
IT_DATA_SUB-BUKRS.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB02'.
PERFORM BDC_FIELD USING 'ANLA-TXT50'
V_SUBSTR1. "IT_DATA_SUB-TXT50.
PERFORM BDC_FIELD USING 'ANLA-TXa50'
V_SUBSTR2. "IT_DATA_SUB-TXT50.
****perform bdc_field using 'ANLH-ANLHTXT'
it_data_sub-ANLHTXT_004.
PERFORM BDC_FIELD USING 'ANLA-SERNR'
IT_DATA_SUB-SERNR.
PERFORM BDC_FIELD USING 'ANLA-MENGE'
IT_DATA_SUB-MENGE.
****perform bdc_field using 'ANLA-MEINS'
it_data_sub-MEINS_007.
****perform bdc_field using 'RA02S-XHIST'
it_data_sub-XHIST_008.
PERFORM BDC_FIELD USING 'ANLA-INVZU'
IT_DATA_SUB-INVZU.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-AKTIV'.
PERFORM BDC_FIELD USING 'ANLA-AKTIV'
IT_DATA_SUB-AKTIV.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB03'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLZ-GSBER'.
****perform bdc_field using 'ANLZ-GSBER'
it_data_sub-GSBER_011.
****perform bdc_field using 'ANLZ-KOSTL'
it_data_sub-KOSTL_012.
PERFORM BDC_FIELD USING 'ANLZ-STORT'
IT_DATA_SUB-STORT.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB04'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ORD41'.
PERFORM BDC_FIELD USING 'ANLA-ORD41'
IT_DATA_SUB-ORD41.
PERFORM BDC_FIELD USING 'ANLA-ORD42'
IT_DATA_SUB-ORD42.
****perform bdc_field using 'RA02S-EQANZ'
it_data_sub-EQANZ_016.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB07'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-LIFNR'.
PERFORM BDC_FIELD USING 'ANLA-LIFNR'
IT_DATA_SUB-LIFNR.
****perform bdc_field using 'ANLA-LIEFE'
IT_DATA_SUB-LIEFE.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB08'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-LEART'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SELZ'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'T093T-AFBKTX(01)'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLB-NDPER'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTD'.
PERFORM BDC_FIELD USING 'ANLB-NDJAR'
IT_DATA_SUB-NDJAR.
PERFORM BDC_FIELD USING 'ANLB-NDPER'
IT_DATA_SUB-NDPER.
****perform bdc_field using 'ANLB-AFABG'
record-AFABG_029.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
IF IT_DATA_SUB-BWASL IS INITIAL.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA_SUB-ANBTR01_01.
Accu deprn automatically calculated by system changed on 6th Aug.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
IT_DATA_SUB-ANBTR01_06.
ELSE.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTB'.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
IT_DATA_SUB-BZDAT.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
IT_DATA_SUB-BWASL.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA_SUB-ANBTR01.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
****perform bdc_transaction using 'AS94'.
ENDIF.
REFRESH MESSTAB.
CALL TRANSACTION 'AS94' USING BDCDATA
MODE H_MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.
IF SY-SUBRC = 0.
READ TABLE MESSTAB INDEX 1.
IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.
DATA AN1 TYPE ANLN1.
DATA AN2 TYPE ANLN2.
GET PARAMETER ID 'AN2' FIELD AN2.
IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.
MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.
ELSE.
IT_DATA_SUB-ERR_SUB1 = 'X'.
MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.
ENDIF.
REFRESH BDCDATA.
ENDLOOP.
***ENDFORM. " sUB_upload
****& Form SUB_UPLOAD1
text
***FORM SUB_UPLOAD1 .
LOOP AT IT_DATA_SUB WHERE ERR_SUB NE 'X'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=MAST'.
PERFORM BDC_FIELD USING 'ANLA-ANLN1'
IT_DATA_SUB-ANLN1.
PERFORM BDC_FIELD USING 'ANLA-BUKRS'
IT_DATA_SUB-BUKRS.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB02'.
PERFORM BDC_FIELD USING 'ANLA-TXT50'
IT_DATA_SUB-TXT50.
****perform bdc_field using 'ANLH-ANLHTXT'
it_data_sub-ANLHTXT_004.
PERFORM BDC_FIELD USING 'ANLA-SERNR'
IT_DATA_SUB-SERNR.
PERFORM BDC_FIELD USING 'ANLA-MENGE'
IT_DATA_SUB-MENGE.
****perform bdc_field using 'ANLA-MEINS'
it_data_sub-MEINS_007.
****perform bdc_field using 'RA02S-XHIST'
it_data_sub-XHIST_008.
PERFORM BDC_FIELD USING 'ANLA-INVZU'
IT_DATA_SUB-INVZU.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-AKTIV'.
PERFORM BDC_FIELD USING 'ANLA-AKTIV'
IT_DATA_SUB-AKTIV.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB03'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLZ-GSBER'.
****perform bdc_field using 'ANLZ-GSBER'
it_data_sub-GSBER_011.
****perform bdc_field using 'ANLZ-KOSTL'
it_data_sub-KOSTL_012.
PERFORM BDC_FIELD USING 'ANLZ-STORT'
IT_DATA_SUB-STORT.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB04'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ORD41'.
PERFORM BDC_FIELD USING 'ANLA-ORD41'
IT_DATA_SUB-ORD41.
PERFORM BDC_FIELD USING 'ANLA-ORD42'
IT_DATA_SUB-ORD42.
****perform bdc_field using 'RA02S-EQANZ'
it_data_sub-EQANZ_016.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB07'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-LIFNR'.
PERFORM BDC_FIELD USING 'ANLA-LIFNR'
IT_DATA_SUB-LIFNR.
****perform bdc_field using 'ANLA-LIEFE'
IT_DATA_SUB-LIEFE.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB08'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-LEART'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SELZ'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'T093T-AFBKTX(01)'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0195'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLB-NDPER'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTD'.
PERFORM BDC_FIELD USING 'ANLB-NDJAR'
IT_DATA_SUB-NDJAR.
PERFORM BDC_FIELD USING 'ANLB-NDPER'
IT_DATA_SUB-NDPER.
****perform bdc_field using 'ANLB-AFABG'
record-AFABG_029.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ALTB'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA_SUB-ANBTR01_01.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(06)'
IT_DATA_SUB-ANBTR01_06.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BZDAT(01)'
IT_DATA_SUB-BZDAT.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-BWASL(01)'
IT_DATA_SUB-BWASL.
PERFORM BDC_FIELD USING 'RALT_DYNP_STRUC-ANBTR01(01)'
IT_DATA_SUB-ANBTR01.
PERFORM BDC_DYNPRO USING 'SAPLALTD' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
****perform bdc_transaction using 'AS94'.
REFRESH MESSTAB.
CALL TRANSACTION 'AS94' USING BDCDATA
MODE H_MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.
IF SY-SUBRC = 0.
READ TABLE MESSTAB INDEX 1.
IT_DATA_sub-SUB_CODE = MESSTAB-MSGV1.
DATA AN1 TYPE ANLN1.
DATA AN2 TYPE ANLN2.
GET PARAMETER ID 'AN2' FIELD AN2.
IT_DATA_SUB-SUB_CODE = AN2. "MESSTAB-MSGV1.
MODIFY IT_DATA_SUB TRANSPORTING SUB_CODE.
ELSE.
IT_DATA_SUB-ERR_SUB1 = 'X'.
MODIFY IT_DATA_SUB TRANSPORTING ERR_SUB1.
ENDIF.
REFRESH BDCDATA.
ENDLOOP.
***ENDFORM. " sUB_upload
and one more thing i face some issues when doing bdc for AS01, so i use AS91 and AS92 for uploading by using LSMW (direct input method and recording method) and it was successful.(if u have to do coding go for BDC/BAPI or there is no coding better to choose LSMW (it is the easiest way) as of my knowledge, so before starting just analyze once which method is best for ur requirement.
Reward Points for Useful Answers
Thanks
Naveen khan
Message was edited by:
Pattan Naveen -
BDC Recording for Sorting a coloum
Hi All,
I have to do BDC Recording for a transaction.During recording i have to select a coloum and sort it ascending and then do further processing.
BDC recording happens for sorting but not for selecting coloum.
and hence it gives error when we process the recording that "Select a coloum".
can u plz tell me how to add seelcting coloum in BDC recorording.
ThanksHi,
You should try to incorporate your functionality using FIND or POSITION button instead of going for sort option.
Find or position button work very good in this scenerio. With find button you can find the desired entry easily.
Hope this will solve your problem.
Regards,
Brajvir -
Create BDC recording for position,job,role
hi all,
i want to create BDC recording for position,job,role . what is the transaction for creating postion,job, role?/??
and i have to check wheather for one job , role is there or not? if not i have to create that role.. similiarly i have to check for position that there is corresponding job is there or not.. if not i have to create the job???
how would i do that??
thanks
SAchinHi Sachin,
1) Creating BDC is an ABAP-ers job and being functional its not ur responsibility. If u really want to do that then u can do it through T.Code - SHDB.
While creating BDC for Position u have to go through T.Cdoe - SHDB and in that give PP01 in the TRANSACTION CODE feild. Then go on for recording. After that ask the help of an ABAP-er.
2) To Check if a POSITION or a JOB is there, then Go to T.Code - PP01, under Obj Abbr. feild put S for POSITION and C for JOB and press enter after entering the POSITION and JOB id. U'll get the result. OK
3) To check for ROLE, u have go to T.Code - PFCG and there check for the particular ROLE u r looking for. Here in this T.Code u can actually create, change and delete the ROLES.OK
Hope this helps,
ARNAV... -
hi gurus,
i want notes for creating materials and to create purchase order using bdc and to upload some datas using that recording from datas in note pad or any external file with screen shots. if any body sent to it ll be very useful to me...
thanks in advance
arunHi,
check the codes for mm01 and me21n.
mm01
report ZBHMAT no standard page heading line-size 255.
DATA:BEGIN OF ITAB OCCURS 0,
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
KZSEL LIKE MSICHTAUSW-KZSEL,
WERKS LIKE RMMG1-WERKS,
VKORG LIKE RMMG1-VKORG,
VTWEG LIKE RMMG1-VTWEG,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS,
SKTOF LIKE MVKE-SKTOF,
TAXKM LIKE MG03STEUER-TAXKM,
GEWEI LIKE MARA-GEWEI,
MTVFP LIKE MARC-MTVFP,
TRAGR LIKE MARA-TRAGR,
LADGR LIKE MARC-LADGR,
END OF ITAB.
DATA BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:/BHARAT/MAT.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'MATERIAL'
KEEP = 'X'
USER = SY-UNAME
PROG = SY-CPROG.
LOOP AT ITAB.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'RMMG1-MATNR'
ITAB-MATNR.
perform bdc_field using 'RMMG1-MBRSH'
ITAB-MBRSH.
perform bdc_field using 'RMMG1-MTART'
ITAB-MTART.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-KZSEL(04)'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
ITAB-KZSEL.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'RMMG1-WERKS'
ITAB-WERKS.
perform bdc_field using 'RMMG1-VKORG'
ITAB-VKORG.
perform bdc_field using 'RMMG1-VTWEG'
ITAB-VTWEG.
perform bdc_field using 'BDC_OKCODE'
'ENTR'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MVKE-SKTOF'
ITAB-SKTOF.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
ITAB-TAXKM.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MVKE-SKTOF'
ITAB-SKTOF.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARC-MTVFP'
ITAB-MTVFP.
perform bdc_field using 'MARA-TRAGR'
ITAB-TRAGR.
perform bdc_field using 'MARC-LADGR'
ITAB-LADGR.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
TABLES
DYNPROTAB = BDCTAB.
REFRESH BDCTAB.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCTAB.
BDCTAB-PROGRAM = PROGRAM.
BDCTAB-DYNPRO = DYNPRO.
BDCTAB-DYNBEGIN = 'X'.
APPEND BDCTAB.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCTAB.
BDCTAB-FNAM = FNAM.
BDCTAB-FVAL = FVAL.
APPEND BDCTAB.
ENDFORM.
me21n
report ZBH_PURORDER no standard page heading line-size 255.
PARAMETERS:P_FILE LIKE IBIPPARMS-PATH.
DATA FILENAME TYPE STRING.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-cprog
dynpro_number = sy-dynnr
IMPORTING
file_name = P_FILE.
START-OF-SELECTION.
FILENAME = P_FILE.
DATA:BEGIN OF XTAB OCCURS 0,
TYP,
DES(255) TYPE C,
END OF XTAB.
DATA:BEGIN OF ITAB OCCURS 0,
SUPERFIELD LIKE MEPO_TOPLINE-SUPERFIELD,
EKORG LIKE MEPO1222-EKORG,
EKGRP LIKE MEPO1222-EKGRP,
BUKRS LIKE MEPO1222-BUKRS,
END OF ITAB.
DATA:BEGIN OF JTAB OCCURS 0,
N(4) TYPE C,
EMATN LIKE MEPO1211-EMATN,
MENGE(13) TYPE C,
NETPR(13) TYPE C,
NAME1 LIKE MEPO1211-NAME1,
END OF JTAB.
DATA:BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA:DELIMITER VALUE '*'.
DATA A TYPE I.
DATA M(4) TYPE N.
DATA L_FNAM(30) TYPE C.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = XTAB.
LOOP AT XTAB.
IF XTAB-TYP = 'H'.
SPLIT XTAB-DES AT DELIMITER INTO ITAB-SUPERFIELD ITAB-EKORG ITAB-EKGRP
ITAB-BUKRS.
JTAB-N = JTAB-N + 1.
APPEND ITAB.
ELSEIF XTAB-TYP = 'I'.
SPLIT XTAB-DES AT DELIMITER INTO JTAB-EMATN JTAB-MENGE JTAB-NETPR
JTAB-NAME1.
APPEND JTAB.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'PORDER'
KEEP = 'X'
USER = SY-UNAME.
LOOP AT ITAB.
A = SY-TABIX.
REFRESH BDCTAB.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_TOPLINE-SUPERFIELD'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4000BUTTON'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1222-EKORG'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4001BUTTON'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
M = 1.
LOOP AT JTAB.
IF JTAB-N = A.
WRITE:/ JTAB.
CONCATENATE 'MEPO1211-EMATN(' M ')' INTO L_FNAM.
perform bdc_field using 'BDC_CURSOR'
L_FNAM.
perform bdc_field using L_FNAM
JTAB-EMATN.
CONCATENATE 'MEPO1211-MENGE(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-MENGE.
CONCATENATE 'MEPO1211-NETPR(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-NETPR.
CONCATENATE 'MEPO1211-NAME1(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-NAME1.
M = M + 1.
ENDIF.
ENDLOOP.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1319-MATKL'.
perform bdc_field using 'MEPO1319-SPINF'
'X'.
perform bdc_field using 'BDC_OKCODE'
'=MESAVE'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'ME21N'
TABLES
DYNPROTAB = BDCTAB.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCTAB.
BDCTAB-PROGRAM = PROGRAM.
BDCTAB-DYNPRO = DYNPRO.
BDCTAB-DYNBEGIN = 'X'.
APPEND BDCTAB.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCTAB.
BDCTAB-FNAM = FNAM.
BDCTAB-FVAL = FVAL.
APPEND BDCTAB.
ENDFORM.
FLAT FILE:
H1171611000001*1000
ICPU116000*1000
ILEY BOARD1010000*1000
IMOUSE66000*1000
H1171711000001*1000
ICPU580000*1000
H1171701000001*1000
IMOUSE33000*1000
ILEY BOARD1010000*1000
rgds,
bharat. -
Code thrownig an error after recording for MM01
Hello BAPI Experts,
I would like to ask that recording using T.Code shdb(for MM01) Mat Type: Raw Material to extend from one plant & storage location to another .My code thrownig an error , as I capture all views
ls it not possible using BDC.
Valuable answer will b appreciated in form of beers!
Thanks in advance!!!!!!
R SinhaHi Sinha..
In recording select Views using PgDn button, You should not use mouse by scrolling it.
I think this will resolve your Problem, still need help plz do message me.
Please do close the thread once you problem is resolved.
Regards,
sg
Maybe you are looking for
-
Effects won't work on Text in After Effects
I must be missing some crucial step because I can't get effects to work on my text. I downloaded After Effects CC. I write text, put a solid, ramped background, add an effect, add a keyframe for the effect and see nothing. I copy what tutorials tell
-
Unable to restore or update software for ipod classic-Assistance required
Albums,Songs and Games that I have purchased through iTunes Store are in my iTunes library but when I try to sync them to my ipod the error " unable to sync to ipod cause you are not authourized to play them on this computer ".Prior to syncing I alwa
-
Use dimension in HSF freeform calculation
Hi everybody, I want to use dimension structure in Oracle Hyperion Strategic Finance Application. I assigned a user defined dimension, to an account. Then, I used a different dimension for any other account. e.g: v300.00.001/A1 - v300.00.002/B1 Now,
-
Pre populate the Primary contact field on Activity when created from an opp
Is there a way to auto populate the Primary contact field when a task is created from an opportunity with a primary contact? Can it be done thru a custom weblink? I think Bob B. may have had some weblink documentation?
-
Using Windows Group Policies in User policy package
I've been using the gp under User Config > Windows Settings > Internet Explorer Maintenance > Connection > Proxy Settings in the User policy Package for a while now to prevent students from getting to https sites. There are some sites though that we