BDC Recording - IL02
Hi,
I'm new to abap. Hope any expert able to help me out.
I'm doing upload program to link the document to functional location via BDC recording IL02.
1) How i proceed to check the floc is whether exist in the system?
2) Display the out the floc name if not exist.
3) skip/ delete this floc and proceed rest of uploading.
Below are part of my code & recording. Appreciate can provide guide code to me.
Thanks!!
<u><b>Internal Table:</b></u>
DATA : BEGIN OF i_input OCCURS 0,
tplnr LIKE iflo-tplnr, "Functional Location
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
<u><b>BDC Recording</b></u>
FORM BDC_Functional_Location.
DATA : wa_file LIKE i_input.
IF NOT i i_input[] IS INITIAL.
SORT i_input BY tplnr.
LOOP AT i_input.
wa_file = i_input.
REFRESH i_bdcdata.
CLEAR i_bdcdata.
<u>Screen 1</u>
PERFORM bdc_dynpro USING 'SAPMILO0' '1110' c_on.
PERFORM bdc_field USING 'BDC_CURSOR'
'IFLO-TPLNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'IFLO-TPLNR'
wa_file-tplnr.
<u>Screen 2</u>
PERFORM bdc_dynpro USING 'SAPMILO0' '2100' c_on.
PERFORM bdc_field USING 'BDC_CURSOR'
'IFLO-PLTXT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=T\05'.
<u>Screen 3</u>
PERFORM bdc_dynpro USING 'SAPMILO0' '2100' c_on.
PERFORM bdc_field USING 'BDC_OKCODE'
'=CV140_INS'.
<u>Screen 4</u>
PERFORM bdc_dynpro USING 'SAPMILO0' '2100' c_on.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'DRAW-DOKVR(01)'.
PERFORM bdc_field USING 'DRAW-DOKAR(01)'
wa_file-dokar.
PERFORM bdc_field USING 'DRAW-DOKNR(01)'
wa_file-doknr.
PERFORM bdc_field USING 'DRAW-DOKTL(01)'
wa_file-doktl.
PERFORM bdc_field USING 'DRAW-DOKVR(01)'
wa_file-dokvr.
PERFORM bdc_field USING 'GF_ALLE'
'X'.
<u>Screen 5</u>
PERFORM bdc_dynpro USING 'SAPMILO0' '2100' c_on.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_transaction USING ' ' 'IL02' 'N'.
ENDLOOP.
ENDIF.
ENDFORM.
Hi All,
Below is my code... I only need to update the cost center belongs to the affected functional location... Please help... Thanks.
data: PATH TYPE STRING,
FULLPATH TYPE STRING,
USER_ACTION TYPE I,
PCFILEX TYPE STRING,
g_pathresult TYPE string,
g_file TYPE string.
DATA: gt_fltab TYPE filetable,
g_rcode TYPE i.
data: DATALINE TYPE STRING.
INFILE TYPE STANDARD TABLE OF STRING.
data: begin of infile occurs 0,
c1(30) type C,
C2(10) type C,
end of infile.
DATA: IT_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
WA_BDCDATA TYPE BDCDATA.
data: begin of it_final occurs 0,
tplnr like bdcdata-fval, "Function Location, iflo-tplnr
kostl like bdcdata-fval, "Cost Center, itob-kostl
tplnr(25) type C,
kostl(10) type C,
end of it_final.
*****include bdcrecx1.
Selection screen
PARAMETERS: p_fnam LIKE rlgrap-filename OBLIGATORY.
*initialization.
At SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fnam.
INCLUDE yzz_incldefaultdir.
MOVE: g_filename TO g_pathresult.
Get filename for upload
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
DEFAULT_FILENAME = g_pathresult
CHANGING
file_table = gt_fltab
rc = g_rcode
USER_ACTION = USER_ACTION
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
READ TABLE gt_fltab INDEX 1 INTO p_fnam.
ENDIF.
IF USER_ACTION EQ 0.
g_file = p_fnam.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = fullpath
filetype = 'ASC'
has_field_separator = 'X'
CHANGING
data_tab = it_final[]
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
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF SY-SUBRC <> 0.
MESSAGE ID 'ZU' TYPE 'E' NUMBER '007' WITH p_fnam.
ELSE.
READ TABLE gt_fltab INDEX 1 INTO p_fnam.
ENDIF.
ENDIF.
start-of-selection.
perform f_upload.
*perform open_group.
*perform bdc_dynpro using 'SAPMILO0' '1110'.
*perform bdc_field using 'BDC_CURSOR'
'IFLO-TPLNR'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'IFLO-TPLNR'
'AK31-AP1-010-B700 -B700'.
*perform bdc_field using 'RILO0-TPLKZ'
'PMST1'.
*perform bdc_dynpro using 'SAPMILO0' '2100'.
*perform bdc_field using 'BDC_CURSOR'
'IFLO-PLTXT'.
*perform bdc_field using 'BDC_OKCODE'
'=T\03'.
*perform bdc_field using 'IFLO-PLTXT'
'ABS WASTE WATER STORAGE TANK'.
*perform bdc_dynpro using 'SAPMILO0' '2100'.
*perform bdc_field using 'BDC_OKCODE'
'=BU'.
*perform bdc_field using 'IFLO-PLTXT'
'ABS WASTE WATER STORAGE TANK'.
*perform bdc_field using 'BDC_CURSOR'
'ITOB-KOSTL'.
*perform bdc_field using 'ITOB-BUKRS'
'KP01'.
*perform bdc_field using 'ITOB-KOSTL'
'C68312'.
*perform bdc_field using 'ITOB-IWERK'
'KP13'.
*perform bdc_field using 'ITOB-INGRP'
'MP1'.
*perform bdc_field using 'ITOBATTR-GEWRK'
'MECH #1'.
*perform bdc_field using 'ITOBATTR-WERGW'
'KP13'.
*perform bdc_field using 'ITOB-RBNR'
'M'.
*perform bdc_transaction using 'IL02'.
*perform close_group.
*& Form begin
text
-->P_0191 text
-->P_0192 text
-->P_0193 text
FORM begin USING PROG TYPE BDCDATA-PROGRAM
DYNPRO TYPE BDCDATA-DYNPRO
DYNBEGIN TYPE BDCDATA-DYNBEGIN.
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROG.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = DYNBEGIN.
CLEAR wa_BDCDATA.
wa_BDCDATA-PROGRAM = PROG.
wa_BDCDATA-DYNPRO = DYNPRO.
wa_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO IT_final.
APPEND WA_BDCDATA.
ENDFORM. " begin
*& Form info_tc
text
-->P_0197 text
-->P_IT_FINAL_TPLNR text
FORM info_tc USING FNAM TYPE any
FVAL TYPE any.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_final.
ENDFORM. " info_tc
*& Form f_upload
text
--> p1 text
<-- p2 text
FORM f_upload .
clear: g_file.
g_file = p_fnam.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = g_file
filetype = 'ASC'
has_field_separator = '|'
TABLES
data_tab = infile
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
disk_full = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID 'ZU' TYPE 'E' NUMBER '007' WITH p_fnam.
ENDIF.
perform f_call_trans.
ENDFORM. " f_upload
*& Form f_call_trans
text
--> p1 text
<-- p2 text
FORM f_call_trans .
types: begin of t_Data,
C1 TYPE BDCDATA-FVAL, "Material#
C2 TYPE BDCDATA-FVAL, "Industry Sect.
end of t_data.
DATA: C1 TYPE BDCDATA-FVAL,
C2 TYPE BDCDATA-FVAL.
data: IT_DATA TYPE STANDARD TABLE OF t_Data,
WA_DATA like line of infile.
LOOP AT infile INTO WA_DATA.
CLEAR it_bdcdata. REFRESH it_bdcdata.
PERFORM begin USING 'SAPMILO0' '1110' 'X'.
perform info using 'BDC_CURSOR' 'IFLO-TPLNR'.
perform info using 'BDC_OKCODE' '/00'.
PERFORM info USING 'IFLO-TPLNR' WA_DATA-C1.
perform info using 'BDC_OKCODE' '/00'. "=BU
PERFORM begin USING 'SAPMILO0' '2100' 'X'.
perform info using 'BDC_OKCODE' '/00'. "=BU
perform info using 'BDC_CURSOR' 'ITOB-KOSTL'.
PERFORM info USING 'ITOB-KOSTL' WA_DATA-C2.
perform info using 'BDC_OKCODE' '=YES'.
CALL TRANSACTION 'IL02' USING it_FINAL MODE 'A' UPDATE 'L'.
ENDLOOP.
ENDFORM. " f_call_trans
*& Form info
text
-->P_0397 text
-->P_0398 text
FORM info USING fnam type any
fval type any.
*FNAM TYPE BDCDATA-FNAM
FVAL TYPE BDCDATA-FVAL.
VALUE(LINNO) TYPE I.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
CLEAR wa_BDCDATA.
wa_bDCDATA-FNAM = FNAM.
wa_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_final.
APPEND WA_BDCDATA.
ENDFORM. " info
Similar Messages
-
Hi I am having a problem in BDC Recording. My requirement is that when I input data in transaction fb02 to block the invoices, It shows a list of invoices. Now i need to double click that item(line) in which PK = 06 at runtime during bdc recording. During BDC recording it takes the line number on which we have clicked which is constant but i want it dynamic that if item 1 is having PK=6, that line should be double clicked and if item 3 is having PK=6, the third item should be double clicked to open another screen. Kindly help me... Thanks in advance.
Hi Ravi,
While writing your code that is in your code you know which line number is having the PK = 06, then you can use the same line number and add the code for double click after that.
Regards,
Atish -
hi gurus,
i am trying to do a material master creation using BDC recording,
i am new i dont know how to modify the code,
the following is the code, please let me know how to make changes.
report ZTEST95
no standard page heading line-size 255.
include bdcrecx1.
parameters: dataset(132) lower case default
'C:\Documents and Settings\Deskt'
& 'op\test95.txt'.
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,
data element: MATNR
MATNR_001(040),
data element: MBRSH
MBRSH_002(001),
data element: MTART
MTART_003(004),
data element: REF_MATNR
MATNR_004(040),
data element: XFELD
KZSEL_01_005(001),
data element: MAKTX
MAKTX_006(040),
data element: MEINS
MEINS_007(003),
data element: MATKL
MATKL_008(009),
data element: SPART
SPART_009(002),
data element: MTPOS_MARA
MTPOS_MARA_010(004),
data element: BRGEW
BRGEW_011(017),
data element: GEWEI
GEWEI_012(003),
data element: NTGEW
NTGEW_013(017),
end of record.
End generated data section ***
start-of-selection.
perform open_dataset using dataset.
perform open_group.
do.
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'
'=ENTR'.
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_field using 'RMMG1_REF-MATNR'
record-MATNR_004.
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_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 'MARA-MEINS'
record-MEINS_007.
perform bdc_field using 'MARA-MATKL'
record-MATKL_008.
perform bdc_field using 'MARA-SPART'
record-SPART_009.
perform bdc_field using 'MARA-MTPOS_MARA'
record-MTPOS_MARA_010.
perform bdc_field using 'BDC_CURSOR'
'MARA-BRGEW'.
perform bdc_field using 'MARA-BRGEW'
record-BRGEW_011.
perform bdc_field using 'MARA-GEWEI'
record-GEWEI_012.
perform bdc_field using 'MARA-NTGEW'
record-NTGEW_013.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
enddo.
perform close_group.
perform close_dataset using dataset.
thanks.Hi,
It is better if the Material Master creation step is done by LSMW - Direct Input method with the following object:
Object 0020 Material master
Method 0000
Program name RMDATIND
Program type D Direct input
Check the program documentation for more details.
For a sample data file generation ( Sequential file ), check the program RMDATGEN
If the reqmt., is for a repetetive loading of Material Master you could schedule / execute the LSMW by following program: /SAPDMC/SAP_LSMW_INTERFACE.
Hope this helps.
Best Regards, Murugesh -
Need help for bdc recording TC fp05
Hi,
My requirement is: I want to create a Payment lot using fp05 and then post
it through a program.
First i want to know is there any BAPI available to do that.
I couldnt find any BAPI. That is why i did BDC Recording. The recording is working till Payment Lot creation. But after creation when i try to post the lot, it is giving status as "Direct Posting Stopped". Again if i come out of the program and then manually post it, it is working fine. But through program if i try to post it, it is giving status as "Direct Posting Stopped".
Is this because we cannot Post a Payment Lot programatically or some Authorisation issue is there.
Can anyone respond immediately
Regards,
SheronHi Raj,
May be this can be useful.
BAPI_INSPOPER_RECORDRESULTS
You can search other in se37 BAPIINSP.
Regards,
Amit Mittal. -
What is the tcode for bdc recording and how to do in hr-abap for pa and om
hi,
I need to do the bdc recording for pa and om. So, can any of you tell me how to do and what are the tcodes we have to use.
thanks & regards,
Sekhar.Hi ,
Here is the link from you will get all the transaction code
http://www.sap-basis-abap.com/saphr004.htm
As far PA specfic some tcodes are given below
PA20 Display HR Master Data
PA30 Maintain HR Master Data
PA40 Personnel Actions
PA41 Correct Actions
PA42 Fast Entry for Actions
PA46 Import from Resumix
PA47 Export to Resumix
PA48 Hiring from non-SAP system
PA51 Display Time Data
PA53 Display Time Data
PA61 Maintain Time Data
PA62 List Entry of Additional Data
PA63 Maintain Time Data
PA64 Calendar Entry
PA70 Fast Entry
PA71 Fast Entry of Time Data
PA88 Benefits
For OM specific
PP01 Maintain Plan Data (menu-guided) -
How to use BDC recording in Workflow.
Hi experts,
Anyone kindly help me for the following case...
If sales order gets created, mail has to be sent to every user. Also for that sales order, delivery should be created in background and again mail has to be sent to all users...
I m clear with sending mail. but i m struggled while creating delivery in background. i dont know how to do this. I hav an idea that it can be created using BDC recording and this recording program can be called in our method which is created in our business object.
How to create a single BDC recording to create sales order as well as creating delivery in background... Is it possible to do like this. Or is there any function module to create delivery in background with respect to sales order number?
kindly give some suggestion and step by step procedure to do this...
Thanks in advance...
Regards
Raaams...Hi Ram
Check this BAPI once BAPI_OUTB_DELIVERY_CREATE_SLS.
If this doesnt help do BDC recording and create a FM with the help of BDC recording. Please note that Call Transaction should happen in background otherwise your BDC wont work.
Please revert back if you have any queries.
Regards,
Gautham Paspala -
Problem with SM37 BDC recording
Hi ,
I want to change the output device for the job scheduled of 1000 pgms in SM37.
For this i am using BDC recording.
But when i run the recording, it does not fill the data and does not move from 1 screen to other screen.
I have checked the recording, and everything got recorded.
Please suggest .
Thanks in advance.
Rgds/AbhiHi,
Why not make things simpler by using FM BP_CHANGE_JOB_STEP. Parameters required are:
JOBNAME
JOBCOUNT
STEP-PROGRAM & STEP-TYP (equal to 'A')
STEP_NUM
ALLPRIPAR-PDEST
Presumably you will have the info for JOBNAME, JOBCOUNT etc from your BDC feed. To preserve the rest of the print parameters then use something like FM BP_JOB_READ and fill in ALLPRIPAR fields.
Thanks,
Pete -
Why some screens are hiddens in BDC record mode?
I'm trying to create a BDC record in VA01 transaction but in this mode some screens are hidden just like screen "Material substitution(selecting a material)" Dynpro 800 Program "SAPMV45A"
Is it possible to show this screen in BDC recorder? how can i do it?
RegardsHi,
i´m no expert in this but for a recording of material substitution you could try with transactions VB12 or VB13
Best regards. -
BDC Recording - Make a field required
Dear Experts,
We are using a BDC recording to call MIRO and send it to an agent via workflow using a z-table.
The customer wants the baseline date on this recording grey'ed out and the business area field required.
The baseline date is on the "PAYMENT" tab of MIRO and Business Area on the "DEATILS" tab.
I have created a screen and transaction variant a year ago and assigned it to the t-code, but now with the BDC calling MIRO for the INVOICE Scanning project, these fields can be overwritten and left out.
How can I do it via BDC?
Transnet Freight Rail
Edited by: Annelize Meyer on Mar 17, 2010 1:39 PMYou could create a on-submit pl/sql validation on 'p2_estim_val'. The validation code will return a failure if the value of p2_estim_val is not specified if the value of p2_reason_to_scap_sell is non-null
The validation code could be something as simple as
if not :p2_reason_to_scap_sell is null and :p2_estim_val is null then
return 'A value is required for p2_estim_val';
end if;varad -
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.
Maybe you are looking for
-
Is it possible to replace \ in a file name with \\
String FileS = JOptionPane.showInputDialog(null, "Please enter path to file:", "Getting Pathname", JOptionPane.QUESTION_MESSAGE); String FileP = FileS.replaceAll("\","\\"); This is what I have how can I get it to work?
-
Hi, Anybody tell me why use RMAN CATALOG and what benifits if i have create catalog ?
-
Hi Deposits Of Cash and Checks. (Banking-> Deposits->Deposit) If you enter the amount greater than the balance in the G/L account field it does not accept. If you try to deposit an amount greater than the account balance, the system will block you.
-
Itunes freeze on Vista 32Bit with Ipad2
Hi All. I have the following: a. Ipad2 64GB wifi - 4.3 b. Windows Vista 32 Bit Home Premium c. Toshiba laptop satellite with 4GB ram and 2+Ghz proc d. Itunes 10.2.1.1 It took me considerable time (6 hours +) to get Itunes to start running on my syste
-
Hi All I want to create a bootable Mavericks USB key (8G) but installEDS. dmg does'nt exist in my HD. How can i dowload this? Thank you