Error in BDC programming
I require to develop a bdc for T. CODE vk11. while running the bdc in foreground mode an error message is coming
"Screen 0000 is too large for internal batch input area".
can anyone help me out on this.
REPORT z_vk11_zprc
NO STANDARD PAGE HEADING LINE-SIZE 255.
PARAMETERS: p_file LIKE rlgrap-filename.
PARAMETERS: m_mode(1) DEFAULT 'P'.
PARAMETERS : p_item TYPE i DEFAULT 18.
DATA: BEGIN OF irec OCCURS 0,
zzlocn LIKE komg-zzlocn,
zzpcode LIKE komg-zzpcode,
zzbqcode LIKE komg-zzbqcode,
kunnr LIKE komg-kunnr, "Customer No
kbetr LIKE konp-kbetr, "Value
konwa LIKE konp-konwa, "Rate unit (INR)
kpein LIKE konp-kpein, "Condition pricing unit (1)
kmein like KONP-KMEIN, "Condition unit (tO)
konp LIKE konp-kmein,
datab LIKE rv13a-datab, "FROM DATE
datbi LIKE rv13a-datbi, "TO DATE
zterm LIKE konp-zterm, "TERM
END OF irec.
DATA : irec_item LIKE irec OCCURS 0 WITH HEADER LINE ,
it_bdc TYPE TABLE OF bdcdata WITH HEADER LINE .
DATA : bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 .
DATA: m_irec_item TYPE i.
DATA : w_pbset(30) VALUE 'DF05B-PSBET',
w_kunnr(30) VALUE 'KOMG-KUNNR',
w_kbetr(30) VALUE 'KONP-KBETR',
w_konwa(30) VALUE 'KONP-KONWA',
w_kpein(30) VALUE 'KONP-KPEIN',
w_kmein(30) VALUE 'KONP-KMEIN',
w_datab(30) VALUE 'RV13A-DATAB',
w_datbi(30) VALUE 'RV13A-DATBI',
w_zterm(30) VALUE 'KONP-ZTERM',
w_counter(2) TYPE n VALUE '00'.
at selection-screen on value-request for p_file.
perform open_window.
*include bdcrecx1.
START-OF-SELECTION.
PERFORM fill_itab.
end-OF-SELECTION.
sort irec by zzlocn zzpcode zzbqcode.
loop at irec.
move-corresponding irec to irec_item.
append irec_item.
endloop.
delete adjacent duplicates from irec comparing zzlocn zzpcode zzbqcode.
*perform open_group.
perform fill_bdc.
form fill_bdc.
LOOP AT irec.
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ANTA'.
PERFORM bdc_field USING 'RV13A-KSCHL'
'ZPRC'.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(07)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(01)'
PERFORM bdc_field USING 'RV130-SELKZ(07)'
'X'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1916'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-KUNNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMG-ZZLOCN'
IREC-ZZLOCN."'040'.
PERFORM bdc_field USING 'KOMG-ZZPCODE'
IREC-ZZPCODE."'C02'.
PERFORM bdc_field USING 'KOMG-ZZBQCODE'
IREC-ZZBQCODE."'TATXGP'.
CLEAR w_counter.
LOOP AT irec_item WHERE zzlocn = irec-zzlocn AND zzpcode = irec-zzpcode
AND zzbqcode = irec-zzbqcode.
w_counter = w_counter + 01.
w_kunnr = 'KOMG-KUNNR'.
w_kbetr = 'KONP-KBETR'.
w_konwa = 'KONP-KONWA'.
w_kmein = 'KONP-KMEIN'.
w_kpein = 'KONP-KPEIN'.
w_kmein = 'KONP-KMEIN'.
w_datab = 'RV13A-DATAB'.
w_datbi = 'RV13A-DATBI'.
w_zterm = 'KONP-ZTERM'.
CONCATENATE w_kunnr '(' w_counter ')' INTO w_kunnr.
CONCATENATE w_kbetr '(' w_counter ')' INTO w_kbetr.
CONCATENATE w_konwa '(' w_counter ')' INTO w_konwa.
CONCATENATE w_kpein '(' w_counter ')' INTO w_kpein.
CONCATENATE w_kmein '(' w_counter ')' INTO w_kmein.
CONCATENATE w_datab '(' w_counter ')' INTO w_datab.
CONCATENATE w_datbi '(' w_counter ')' INTO w_datbi.
CONCATENATE w_zterm '(' w_counter ')' INTO w_zterm.
PERFORM bdc_field USING w_kunnr "'KOMG-KUNNR(01)'
irec_item-kunnr.
PERFORM bdc_field USING w_kbetr "'KONP-KBETR(01)'
irec_item-kbetr.
PERFORM bdc_field USING w_konwa "'KONP-KONWA(01)'
irec_item-konwa.
PERFORM bdc_field USING w_kpein "'KONP-KPEIN(01)'
irec_item-kpein.
PERFORM bdc_field USING w_kmein "'KONP-KMEIN(01)'
irec_item-kmein.
PERFORM bdc_field USING w_datab "'RV13A-DATAB(01)'
irec_item-datab.
PERFORM bdc_field USING w_datbi "'RV13A-DATBI(01)'
irec_item-datbi.
PERFORM bdc_field USING w_zterm "'KONP-ZTERM(01)'
irec_item-zterm.
if w_counter eq p_item . "no of visible line items in user screen.
PERFORM bdc_dynpro USING 'SAPMV13A' '1916'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-KUNNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=NEWP'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1916'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-KUNNR(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
w_counter = 2.
endif.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMV13A' '1916'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-KUNNR(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
call TRANSACTION 'VK11' USING it_bdc update 'S' mode m_mode MESSAGES INTO bdcmsgcoll.
ENDLOOP.
ENDFORM.
*& Form bdc_dynpro
text
-->PROGRAM text
-->DYNPRO text
FORM bdc_dynpro USING program dynpro.
CLEAR it_bdc.
it_bdc-program = program.
it_bdc-dynpro = dynpro.
it_bdc-dynbegin = 'X'.
APPEND it_bdc.
ENDFORM. "bdc_dynpro
*& Form bdc_field
text
-->FNAM text
-->FVAL text
FORM bdc_field USING fnam fval.
if fval <> nodata.
CLEAR it_bdc.
it_bdc-fnam = fnam.
it_bdc-fval = fval.
APPEND it_bdc.
endif.
ENDFORM. "bdc_field
*& Form OPEN_WINDOW
text
--> p1 text
<-- p2 text
form OPEN_WINDOW .
call function 'KD_GET_FILENAME_ON_F4'
exporting
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
field_name = 'P_FILE'
STATIC = ' '
MASK = ' '
changing
file_name = p_file
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. " OPEN_WINDOW
*& Form FILL_ITAB
text
--> p1 text
<-- p2 text
form FILL_ITAB .
data: l_file type string.
l_file = p_file.
call function 'GUI_UPLOAD'
exporting
filename = l_file
filetype = 'ASC'
has_field_separator = '|'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = irec[]
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.
endform. " FILL_ITAB
Similar Messages
-
Error in BDC program for Block vendor in SAP R/3
Hello friends,
I wrote a BDC program to block vendor using FK02.
When I debug the program in <b>No screen</b> mode
the program gives a error 'No batch input data for screen SAPMSSY3 0131.
But the screen name and screen number is not available in the program.
When I execute without debugging in No screen mode, the program works correctly.
When I run in ALL screen mode, the program works correctly and the program does not prompt for SAPMSSY3 0131 screen.
Is there any solution for this problem.check this
... MODE mode
Effect
The processing mode can take the following values:
'A' Display screen
'E' Display only if an error occurs
'N' Do not display
<b>'P' Do not display; debugging possible</b>
If the MODE addition is omitted, then the processing mode is 'A'.
If a screen is displayed in processing mode 'E' because the system reached the end of the BDC data, the system automatically switches to processing mode 'A'.
If breakpoints are set in a transaction tcod called using the CALL TRANSACTION tcod USING itab variant, these are not actually reached in 'N' mode. The system tries to insert data in the Debugger screen; the call ends with SY-SUBRC = 1001 and the message "Batch input data is not available for screen SAPMSSY3 0131" (S 00 344).
Conversely, in 'P' mode, transaction screens are processed in the background (as in 'N' mode) and debugging is possible.
Regards
Prabhu -
Error in bdc programing code-pls help
hi friends,
I was tring to do a bdc program.But it shows me an error. MY bdc program is jus to upload a 2 fields in vendoe master table.
That is LIFNR,NAME1 field for the new vendors.
I worked out an execl sheet for this, and jus copied it to the text file by selecting all and pasting.
Even then i get an error code that BDC_open does not exits.
MY code is this, please help me if iam wrong.
If anyone can help to make it more understandable,I Kindly request you to try out this program with the screen shot and mail to this id [email protected] would be very thankful for your timely help.
report Z_PK_BDC
no standard page heading line-size 255.
include bdcrecx1.
parameters: dataset(132) lower case.
parameters: p_file like rlgrap-filename default
'C:\SAP TESTING\p_file.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 OCCURS 0,
data element: LIF16
LIFNR_001(016),
data element: BUKRS
BUKRS_002(004),
data element: KTOKK
KTOKK_003(004),
data element: ANRED
ANRED_004(015),
data element: NAME1_GP
NAME1_005(035),
data element: SORTL
SORTL_006(010),
data element: NAME2_GP
NAME2_007(035),
data element: STRAS_GP
STRAS_008(035),
data element: ORT01_GP
ORT01_009(035),
data element: ORT02_GP
ORT02_010(035),
data element: PFORT_GP
PFORT_011(035),
data element: LAND1_GP
LAND1_012(003),
data element: SPRAS
SPRAS_013(002),
end of record.
End generated data section ***
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = record
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
OTHERS = 10.
IF SY-SUBRC <> 0.
WRITE:/ 'SY-SUBRC:', SY-SUBRC.
ENDIF.
LOOP AT RECORD.
*perform open_dataset using dataset.
*perform open_group.
*do.
*read dataset dataset into record.
*if sy-subrc <> 0. exit. endif.
perform bdc_dynpro using 'SAPMF02K' '0105'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
record-LIFNR_001.
perform bdc_field using 'RF02K-BUKRS'
record-BUKRS_002.
perform bdc_field using 'RF02K-KTOKK'
record-KTOKK_003.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
perform bdc_field using 'LFA1-ANRED'
record-ANRED_004.
perform bdc_field using 'LFA1-NAME1'
record-NAME1_005.
perform bdc_field using 'LFA1-SORTL'
record-SORTL_006.
perform bdc_field using 'LFA1-NAME2'
record-NAME2_007.
perform bdc_field using 'LFA1-STRAS'
record-STRAS_008.
perform bdc_field using 'LFA1-ORT01'
record-ORT01_009.
perform bdc_field using 'LFA1-ORT02'
record-ORT02_010.
perform bdc_field using 'LFA1-PFORT'
record-PFORT_011.
perform bdc_field using 'LFA1-LAND1'
record-LAND1_012.
perform bdc_field using 'LFA1-SPRAS'
record-SPRAS_013.
perform bdc_transaction using 'FK01'.
**enddo.
**perform close_group.
endloop.
**perform close_dataset using dataset.
Thanks in Advance
Rinky123Hi,
If you are using GUI_UPLOAD in 4.7 then the file path whatever you are using currently it won't work. Replace the file path like this.
P_FILE LIKE RLGRAP-FILENAME.
DATA: V_FILE TYPE STRING.
V_FILE = P_FILE.
Now take this v_file for function module.Then only it will open the file otherwise you won't get unable to open file error message.
I observerd that you are getting so many fields from the file to the internal table. -
Error in BDC program which is creating Work Order IW31
Hi All,
I am getting an error - 532 - " Specify only one start time/date " when running bdc program for txn IW31 in back ground. I run the same program in the foreground.. there is no error.. but when I run in background.. I am experiencing the above error.
Thank for Ur time.
Cheers
SenthilHi,
Are you facing this issue during Normal order creation with that functional location ?
Please check CC assignment to functional location and settlement rule applied while saving order.
Thanks
Riyaj -
Error while runing bdc program
hi,
i written one bdc program there are no syntax errors and in flat file also no error records but when uploading data it showing pop up that do you want to save data with 2 push buttons yes or no. i suppose to be it is front end problem how to avoid that.
p.surendar reddyHi,
You have miss a step while recording.. What i mean is you have created
bdc for changing some document. you recorded the fields to be changed
but didn't save before terminating recording.
re-create your recording... and before and click save icon as the last step#
in your recording..
Hope this solves your problem..
Enjoy SAP,
Pankaj Singh. -
BDC programming error for FF67
Hi guys,
I am working on FF67 BDC programming. When I am uploading data from excel, allthe values are getting passed correctly, except in the second screen value-date field (here the date is dispalying as 02.12.2020, though I have given it as 02.12.2008) And also it is displaying an error message as field FEBMKA-KWBTR(1) IS NOT AN INPUT FIELD. Am using ECC 6.0
And in the output it is displaying like below
statement/list is being updated atthe moment
Field FEBMKA-VGMAN(1) is not an input field
Field FEBEP-VALUT(1) is not an input field
Field FEBMKA-KWBTR(1) is not an input field
Warning: Values entered are ignored
Statement/list saved.
waiting for your reply guys.............
Thank you in advance..
KiranHi Avinash,
Thanks for the reply. I didn't get you. How can I use 'write to' statement?
I have written the code as follows
CONCATENATE 'FEBMKA-VGMAN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-transaction.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'
EXPORTING
INPUT = itab-value_date
IMPORTING
OUTPUT = date.
CONCATENATE 'FEBEP-VALUT(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
date.
CONCATENATE 'FEBMKA-KWBTR(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-amount.
CONCATENATE 'FEBMKK-CHECT_KF(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-bank_refchqno.
So, where shall I use the '' write to'' statement.
please suggest me.
bye,
Kiran -
Hi ,
i have written a bdc program for f-02 .here we have 2 posting keys 31 and 40 .when i recored in shdb i can see when i use 31 posting key then i get 302 screen and when i use 40 posting key then i get 300 screen.But the problem is in 302 screen we have new posting keys and new account numbers .how to update these . here is my code . my file is not getting updated when i get screen 302 .Any advice?
REPORT zfip0009 NO STANDARD PAGE HEADING.
TABLES ska1.
DATA: BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
DATA w_date(10) TYPE c.
DATA w_first TYPE c.
DATA w_second TYPE c.
data from flat file
DATA: BEGIN OF t_data OCCURS 0,
bukrs LIKE bkpf-bukrs, "company code
newbs LIKE rf05a-newbs, "Posting Key
newko LIKE rf05a-newko, "New account number(SAP)
wrbtr(13) TYPE c, "amount
dmbtr(13) TYPE c, "sterling local amount "+MW1
mwskz LIKE bseg-mwskz, "Tax code
sgtxt LIKE bseg-sgtxt, "item description
kostl LIKE cobl-kostl, "Cost centre
ps_posid LIKE cobl-ps_posid, "WBS number
aufnr LIKE cobl-aufnr, "Internal order
END OF t_data.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file LIKE rlgrap-filename
DEFAULT 'C:\temp\XSL.txt'.
SELECTION-SCREEN SKIP.
PARAMETERS: p_sess(12) DEFAULT 'GLPOSTING'.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_bldat LIKE bkpf-bldat,
p_budat LIKE bkpf-budat,
p_blart LIKE bkpf-blart,
p_monat LIKE bkpf-monat,
p_bukrs LIKE bkpf-bukrs,
p_bktxt LIKE bkpf-bktxt,
p_xblnr LIKE bkpf-xblnr,
p_waers LIKE bkpf-waers.
SELECTION-SCREEN END OF BLOCK b2.
*SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
*PARAMETERS p_ktopl LIKE ska1-ktopl.
*SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = p_file
DEF_PATH = ' '
mask = ',.,..'
MODE = ' '
TITLE = ' '
IMPORTING
filename = p_file
RC =
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
START OF SELECTION
START-OF-SELECTION.
Get all of the information held on the spreadsheets.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = t_data
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
WRITE :/ 'Failed to Open Input file', p_file.
EXIT.
ENDIF.
REFRESH bdcdata.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = p_sess
user = sy-uname
keep = 'X'.
PERFORM load_bdcdata.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /
'Batch input session', p_sess, 'created: process session via SM35'.
END-OF-SELECTION.
*& Form LOAD_BDCDATA
Load the BDCDATA fields depending
FORM load_bdcdata.
CLEAR: w_first, w_second.
CLEAR bdcdata.
LOOP AT t_data.
IF sy-tabix = 1.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM format_date USING p_bldat.
PERFORM bdc_field USING 'BKPF-BLDAT'
w_date.
PERFORM bdc_field USING 'BKPF-BLART'
p_blart.
PERFORM bdc_field USING 'BKPF-BUKRS'
t_data-bukrs.
PERFORM format_date USING p_budat.
PERFORM bdc_field USING 'BKPF-BUDAT'
w_date.
PERFORM bdc_field USING 'BKPF-WAERS'
p_waers.
PERFORM bdc_field USING 'BKPF-MONAT'
PERFORM bdc_field USING 'BKPF-BKTXT'
p_bktxt.
PERFORM bdc_field USING 'BKPF-XBLNR'
p_xblnr.
PERFORM bdc_field USING 'RF05A-NEWBS'
t_data-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
t_data-newko.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'RF05A-NEWBS'
t_data-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
t_data-newko.
PERFORM bdc_field USING 'RF05A-NEWBK'
t_data-bukrs.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE' 'ENTE'.
ENDIF.
IF t_data-newbs = '31' .
w_second = '1'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-SGTXT'.
PERFORM bdc_field USING 'BSEG-WRBTR'
t_data-wrbtr.
PERFORM bdc_field USING 'BSEG-SGTXT'
t_data-sgtxt.
PERFORM bdc_field USING 'RF05A-NEWBS'
t_data-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
t_data-newko.
IF NOT t_data-kostl IS INITIAL.
PERFORM bdc_field USING 'COBL-KOSTL'
t_data-kostl.
ELSEIF NOT t_data-ps_posid IS INITIAL.
PERFORM bdc_field USING 'COBL-PS_POSID'
t_data-ps_posid.
ELSEIF NOT t_data-aufnr IS INITIAL.
PERFORM bdc_field USING 'COBL-AUFNR'
t_data-aufnr.
ENDIF.
*...start of Amendment MW1
IF p_waers ne 'GBP'.
PERFORM bdc_field USING 'BSEG-DMBTR'
t_data-dmbtr.
ENDIF.
ENDIF.
*...end of Amendment MW1 ENDIF.
IF t_data-newbs = '40' .
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-SGTXT'.
PERFORM bdc_field USING 'BSEG-WRBTR'
t_data-wrbtr.
PERFORM bdc_field USING 'BSEG-SGTXT'
t_data-sgtxt.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE' 'ENTE'.
IF NOT t_data-kostl IS INITIAL.
PERFORM bdc_field USING 'COBL-KOSTL'
t_data-kostl.
ELSEIF NOT t_data-ps_posid IS INITIAL.
PERFORM bdc_field USING 'COBL-PS_POSID'
t_data-ps_posid.
ELSEIF NOT t_data-aufnr IS INITIAL.
PERFORM bdc_field USING 'COBL-AUFNR'
t_data-aufnr.
ENDIF.
PERFORM bdc_field USING 'BSEG-MWSKZ'
t_data-mwskz.
*...start of Amendment MW1
IF p_waers ne 'GBP'.
PERFORM bdc_field USING 'BSEG-DMBTR'
t_data-dmbtr.
ENDIF.
*...end of Amendment MW1
ENDIF.
AT FIRST.
calculate the tax
PERFORM bdc_field USING 'BKPF-XMWST' 'X'.
ENDAT.
IF t_data-newbs = '40' .
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'ENTE'.
IF NOT t_data-kostl IS INITIAL.
PERFORM bdc_field USING 'COBL-KOSTL'
t_data-kostl.
ELSEIF NOT t_data-ps_posid IS INITIAL.
PERFORM bdc_field USING 'COBL-PS_POSID'
t_data-ps_posid.
ELSEIF NOT t_data-aufnr IS INITIAL.
PERFORM bdc_field USING 'COBL-AUFNR'
t_data-aufnr.
ENDIF.
ENDIF.
ENDLOOP.
IF w_second = '1'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
ENDIF.
PERFORM bdc_field USING 'BDC_OKCODE'
'BU'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-WRBTR'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE'
'ENTE'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'F-02'
TABLES
dynprotab = bdcdata.
REFRESH bdcdata.
CLEAR bdcdata.
ENDFORM. " LOAD_BDCDATA
Start of 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.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form format_date
text
FORM format_date USING p_date.
CLEAR w_date.
w_date(2) = p_date+6(2).
w_date+2(1) = '.'.
w_date3(2) = p_date4(2).
w_date+5(1) = '.'.
w_date+6(4) = p_date(4).
ENDFORM. " format_dateIF item-newbs = '09'
OR item-newbs = '19'
OR item-newbs = '29'
OR item-newbs = '39'.
IF item-newum = 'A' OR
item-newum = 'V' OR
item-newum = '1' OR
item-newum = '2' OR
item-newum = '3' OR
item-newum = '5' OR
item-newum = '6' OR
item-newum = 'B' .
PERFORM bdc_dynpro USING 'SAPMF05A' '0304'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWUM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-gsber'
item-gsber.
PERFORM bdc_field USING 'BSEG-PRCTR'
item-prctr.
PERFORM bdc_field USING 'BSEG-ZFBDT'
item-zfbdt1.
PERFORM bdc_field USING 'BSEG-ZUONR'
item-zuonr.
PERFORM bdc_field USING 'BSEG-SGTXT'
item-sgtxt.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1.
READ TABLE item INDEX idx .
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
ENDIF.
IF item-newbs = '09'
OR item-newbs = '19'
OR item-newbs = '29'
OR item-newbs = '39' .
IF item-newum = 'H'
OR item-newum = '4'
OR item-newum = '6'
OR item-newum = '7'
OR item-newum = '8'
OR item-newum = '9'
OR item-newum = 'C'
OR item-newum = 'D'
OR item-newum = 'E'
OR item-newum = 'I'
OR item-newum = 'K'
OR item-newum = 'L'
OR item-newum = 'M'
OR item-newum = 'O'
OR item-newum = 'Q'
OR item-newum = 'R'
OR item-newum = 'T'
OR item-newum = 'U'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0303'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-GSBER'
item-gsber.
PERFORM bdc_field USING 'BSEG-ZFBDT'
item-zfbdt1.
PERFORM bdc_field USING 'BSEG-ZUONR'
item-zuonr.
PERFORM bdc_field USING 'BSEG-SGTXT'
item-sgtxt.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1 .
READ TABLE item INDEX idx .
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
ENDIF.
IF item-newbs = '29' OR item-newbs = '39'.
IF item-newum = '7'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0303'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-ZFBDT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ZK'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-GSBER'
item-gsber.
PERFORM bdc_field USING 'BSEG-ZFBDT'
item-zfbdt1.
PERFORM bdc_field USING 'BSEG-ZUONR'
item-zuonr.
PERFORM bdc_field USING 'BSEG-SGTXT'
item-sgtxt.
PERFORM bdc_dynpro USING 'SAPMF05A' '0332'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-BEWAR'
item-ttype.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1 .
READ TABLE item INDEX idx .
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
ENDIF.
IF item-newbs = '01' OR item-newbs = '11'
OR item-newbs = '05' OR item-newbs = '15'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0301'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-GSBER'
item-gsber.
PERFORM bdc_field USING 'BSEG-ZTERM'
item-zterm.
PERFORM bdc_field USING 'BSEG-ZFBDT'
item-zfbdt.
PERFORM bdc_field USING 'BSEG-ZUONR'
item-zuonr.
PERFORM bdc_field USING 'BSEG-SGTXT'
item-sgtxt.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1 .
READ TABLE item INDEX idx .
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
IF item-newbs = '21' OR item-newbs = '31'
OR item-newbs = '25' OR item-newbs = '35'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-SECCO'
''. "'1000'.
PERFORM bdc_field USING 'BSEG-GSBER'
item-gsber.
PERFORM bdc_field USING 'BSEG-ZTERM'
item-zterm.
PERFORM bdc_field USING 'BSEG-ZFBDT'
item-zfbdt.
PERFORM bdc_field USING 'BSEG-ZUONR'
item-zuonr.
PERFORM bdc_field USING 'BSEG-SGTXT'
item-sgtxt.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1.
READ TABLE item INDEX idx.
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
IF item-newbs = '70' OR item-newbs = '75'.
PERFORM bdc_dynpro USING 'SAPMF05A' '0305'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-PRCTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-GSBER'
item-gsber.
PERFORM bdc_field USING 'COBL-KOSTL'
item-kostl.
PERFORM bdc_field USING 'COBL-PRCTR'
item-prctr.
PERFORM bdc_dynpro USING 'SAPMF05A' '0305'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWBW'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
item-wrbtr.
PERFORM bdc_field USING 'BSEG-BZDAT'
'01.04.2005'.
IF idx1 = '002' .
EXIT.
ENDIF.
idx = idx + 1 .
READ TABLE item INDEX idx .
PERFORM bdc_field USING 'RF05A-NEWBS'
item-newbs.
PERFORM bdc_field USING 'RF05A-NEWKO'
item-newko.
PERFORM bdc_field USING 'RF05A-NEWUM'
item-newum.
PERFORM bdc_field USING 'RF05A-NEWBW'
item-newbw.
CONTINUE.
ENDIF.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_transaction USING 'F-02'.
DELETE item INDEX 1.
DELETE item INDEX 1.
ix = ix + 2 .
ENDDO.
PERFORM close_group. -
BDC Program is not working in background mode
Hi All,
I hv one bdc program for tcode fb02 which is working fine in foreground mode and data is updated to each screen properly. While running the same program in Background mode data is not updated. Can u seggust the solution.
Regards,
Rahul SHi ,
Remove the break point in the BDC performs.
put the break point once u complete the BDC.... otherwise execute the BDC in MODE 'E'.. error mode.
regards,
Rama Reddy
Edited by: ram reddy on Nov 16, 2009 5:37 AM -
Problem in creating a BDC program for transaction cj20n(project sytem)
Hi all,
I am trying to create project,WBS element ,network and activity using a BDC program,
I am able to create to a recording for the transaction cj20n using tcode shdb but when i run the recording it doesnt run properly i am not able to create any thing.
I get error saying that a particular field doesnt exist on the screen.
Is possible to create a BDC program for transaction CJ20N ?
Also is there any other alternative apart from using a BAPI or a function module.
Thanks,
NishantHi,
Check below link for BAPIs of transaction cj20n.
[BAPI for cj20n|BAPI for CJ20N transaction]
Thanks,
Asit Purbey. -
BDC programming using Batch input Session.
Hello Experts.
I'm an ABAP beginner. I've benn practicing BDC programming using Batch input Session
at the moment.
This is the program that upload Local file which has plural records, and put the records into a Session.
These are the records.
413459,KIM EI HWAN121 ,19810607,MIADONG1234
423459,KIM EI HWAN122 ,19810607,MIADONG1235
433459,KIM EI HWAN123 ,19810607,MIADONG1236
443459,KIM EI HWAN124 ,19810607,MIADONG1237
453459,KIM EI HWAN125 ,19810607,MIADONG1238
463459,KIM EI HWAN126 ,19810607,MIADONG1239
I succeeded making Session.
However, for some reaseon, every record in the Session has got the same, value which is the first record.
Why is this happening? And How can I correct the code below?
REPORT ZBCUSER002_BATCH NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID ZBATCH.
= Types definition ===================================================
TYPES: BEGIN OF TYP_LOCAL, "For Local file upload
RECORD(200) TYPE C,
END OF TYP_LOCAL.
= Internal table definition ==============================================
DATA: BEGIN OF BDC_TAB OCCURS 0. "BDCDATA itab
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB.
DATA: BEGIN OF MESSAGE_BDC OCCURS 0. "Message itab
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSAGE_BDC.
DATA: TBL_LOCAL TYPE STANDARD TABLE OF TYP_LOCAL, "Local file itab
F_TBL TYPE FILETABLE. "FILETABLE fot local
= Structure table definition =========================================
DATA: STR_F_TBL LIKE LINE OF F_TBL, "FILETABLE structure
STR_LOCAL TYPE TYP_LOCAL. "Local file structure
= Variable definition ================================================
DATA: LV_RC TYPE I, "Method parameter
ENUMBER TYPE ZT601-ENUMBER, "Employee number
NAME TYPE ZT601-NAME, "Employee name
BIRTH TYPE ZT601-BIRTH, "Birthday
HOMETOWN TYPE ZT601-HOMETOWN, "Hometown
SYSVAL TYPE SY-SUBRC. "System valuible
= Constants definition ===============================================
CONSTANTS: TBL_NAME(10) TYPE C VALUE 'ZT601'. "Table name ZT601
= Parameters definition ==============================================
PARAMETERS: F_NAME TYPE RLGRAP-FILENAME OBLIGATORY, "File path
EXECMODE(1) TYPE C. "Execute mode
INITIALIZATION
*----- Initialize all valuables, structures and internal tables
CLEAR: LV_RC,
STR_F_TBL,
STR_LOCAL,
ENUMBER,
NAME,
BIRTH,
HOMETOWN.
REFRESH: F_TBL,
TBL_LOCAL.
AT SELECTION-SCREEN
*----- When the button next to Parameter 'F_NAME',
*----- File dialog open.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_NAME.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'SELECT FILE'
DEFAULT_FILENAME = '*.TXT'
CHANGING
FILE_TABLE = F_TBL
RC = LV_RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
OTHERS = 3
*----- system valiable check.
*----- If done properly,
*----- Put the path into the File path parameter
IF SY-SUBRC = 0.
READ TABLE F_TBL INTO STR_F_TBL INDEX 1.
F_NAME = STR_F_TBL.
*----- If not done properly, show message
*----- An error occured while getting file path then end program
ELSE.
MESSAGE E000.
ENDIF.
*----- Execute code can only be A or N.
AT SELECTION-SCREEN ON EXECMODE.
IF EXECMODE <> 'A' AND EXECMODE <> 'N'.
MESSAGE E001.
ENDIF.
START-OF-SELECTION
START-OF-SELECTION.
*----- Upload Local file of file path parameter.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = F_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = TBL_LOCAL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6.
*----- System valiable check.
*----- If not done properly, show an error message
*----- An error occured while uploading local file then end program
IF SY-SUBRC <> 0.
MESSAGE E002.
ENDIF.
PERFORM BDC_OPEN.
*----- Loop Internal table
LOOP AT TBL_LOCAL INTO STR_LOCAL.
*----- Spilt the file record and put them into each valiable.
SPLIT STR_LOCAL AT ',' INTO ENUMBER
NAME
BIRTH
HOMETOWN.
*----- Data check Function module
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = BIRTH
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
*----- When error occurs while checking date, show an error message.
*----- (&1) is not date
IF SY-SUBRC <> 0.
MESSAGE E003 WITH BIRTH.
ENDIF.
*-- The first screen of SE11
*----- Screen number 0102 of program id SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SHOW'. "Display button
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME. "ZT601
*-- Table definition screen
*----- Screen number 2000 of program id SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TDED'. "Create entry
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSD02'.
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSED5'.
*-- Data input screen
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SAVE'. "Save
PERFORM BDC_FIELD USING 'ZT601-MANDT'
SY-MANDT. "Client
PERFORM BDC_FIELD USING 'ZT601-ENUMBER'
ENUMBER. "Employee number
PERFORM BDC_FIELD USING 'ZT601-NAME'
NAME. "Employee name
PERFORM BDC_FIELD USING 'ZT601-BIRTH'
BIRTH. "Birthday
PERFORM BDC_FIELD USING 'ZT601-HOMETOWN'
HOMETOWN. "Hometown
PERFORM BDC_FIELD USING 'ZT601-CRDATE'
SY-DATUM. "System date
PERFORM BDC_FIELD USING 'ZT601-CRTIME'
SY-UZEIT. "System time
PERFORM BDC_FIELD USING 'ZT601-CRUSER'
SY-UNAME. "System user
*-- Data input screen (After input)
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'. "Back
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
*-- Table definition screen]
*----- Screen number 2000 of program SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WB_BACK'. "Back
*-- The first screen of SE11
*----- Screen number 0102 of program SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME.
PERFORM BDC_INSERT.
ENDLOOP.
PERFORM BDC_CLOSE.
FORM BDC_DYNPRO *
Put Program-Id, Dynpro screen number, Start point
into DBCDATA
--> PROGRAM *
--> DYNPRO *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDC_TAB.
BDC_TAB-PROGRAM = PROGRAM.
BDC_TAB-DYNPRO = DYNPRO.
BDC_TAB-DYNBEGIN = 'X'.
APPEND BDC_TAB.
ENDFORM.
FORM BDC_FIELD *
Put Field Name and Value into BDCDATA
--> FNAM *
--> FVAL *
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDC_TAB.
BDC_TAB-FNAM = FNAM.
BDC_TAB-FVAL = FVAL.
APPEND BDC_TAB.
ENDFORM.
FORM bdc_process *
FORM BDC_OPEN.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'Testsession'
KEEP = 'X'
USER = SY-UNAME.
IF SY-SUBRC <> 0.
MESSAGE E006 WITH SY-SUBRC.
ENDIF.
ENDFORM.
FORM bdc_insert *
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE11'
TABLES
DYNPROTAB = BDC_TAB
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 E007 WITH SY-SUBRC.
ENDIF.
CLEAR: BDC_TAB.
ENDFORM.
FORM bdc_close *
FORM BDC_CLOSE.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE E008 WITH SY-SUBRC.
ENDIF.
ENDFORM.God I forgot to refresh Internal table after putting record into Session.
Now I'm done.
You guys be careful too. -
Coding not allowed error in BDC
Hi,
Recorded transaction MB1C with "Not a Batch Input Session' option. In the code should I mention this anywhere. Because, I get coding not allowed error while running BDC program.
Please go thru the code below:
perform bdc_dynpro using 'SAPMM07M' '0400'.
perform bdc_field using 'BDC_CURSOR 'MKPF-BKTXT'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MKPF-BLDAT' W_HDR-BLDAT.
perform bdc_field using 'MKPF-BUDAT' W_HDR-BUDAT.
perform bdc_field using 'MKPF-BKTXT' W_HDR-BKTXT.
perform bdc_field using 'RM07M-BWARTWA' W_HDR-BWARTWA.
perform bdc_field using 'RM07M-WERKS' W_HDR-WERKS.
perform bdc_field using 'RM07M-LGORT' W_HDR-LGORT.
perform bdc_field using 'RM07M-WVERS2' W_HDR-WVERS2.
LOOP AT T_MAT INTO W_MAT.
i = i + 1.
IF i > 99.
MOVE i to k.
CONCATENATE 'MSEG-MATNR(' k ')' INTO l_field1.
CONCATENATE 'MSEG-ERFMG(' k ')' INTO l_field2.
ELSE.
MOVE i to j.
CONCATENATE 'MSEG-MATNR(' j ')' INTO l_field1.
CONCATENATE 'MSEG-ERFMG(' j ')' INTO l_field2.
ENDIF.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
l_field2.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using l_field1
W_MAT-MATNR.
perform bdc_field using l_field2
W_MAT-ERFMG.
l_field1 = ''.
l_field2 = ''.
ENDLOOP.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-ERFMG(01)'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_transaction using 'MB1C'.
ENDLOOP.
Regards,
Sriram
Edited by: Sriram_14880 on Jul 28, 2009 2:53 PMHi there is no problem weather u r using option 'Not a Batch Input Session' or not , generally it is used in call transaction
see the documentation of call transaction options (ctu_params).
structure of ctu_params is
DISMODE
UPMODE
CATTMODE
DEFSIZE
RACOMMIT
NOBINPT ( Selection for the symbol field sy-binpt. Values: " " (sy-binpt contains in the called transaction "X"),
"X" (sy-binpt contains in the called transaction " ").
NOBIEND Selection for the system field sy-binpt. Values: " " (sy-binpt contains "X" after the end of the batch input
data in the called transsaction ) "X" (sy-binpt contains " " after the end of the batch input data in the called transaction).
In the new recordinng screen u will have four options ctu_params.
default size
cntinue after commit
Not a Batch Input Session
simulate back......
The above four options u can set manually in call transaction from ctu_params
not a batch input session option refers to ctu_params-NOBINPT.
read the documentation of call transaction statement.
Ram -
Error in BDC for Infotype 0589
Hi friends,
I have developed a BDC program for Infotype 0589. After executing the program to upload data from file, I am getting error message: Field Q0589-ANZHL(7) input value is longer than screen field
Here I am adding my Sample code also.
REPORT ZTEST_0589.
PARAMETERS :
p_file TYPE rlgrap-filename. " Accepts File Name
*" Type declarations...................................................
TYPES :
BEGIN OF type_s_it0589,
pernr TYPE rp50g-pernr, " Personnel Number
inftyp TYPE rp50g-choic, " Infotype
begda TYPE p0589-begda, " Begin Date
endda TYPE p0589-endda, " End Date
lga01 TYPE q0589-lgart,
betrg01 TYPE q0589-betrg,
anzhl01 TYPE q0589-anzhl,
lga02 TYPE q0589-lgart,
betrg02 TYPE q0589-betrg,
anzhl02 TYPE q0589-anzhl,
lga03 TYPE q0589-lgart,
betrg03 TYPE q0589-betrg,
anzhl03 TYPE q0589-anzhl,
lga04 TYPE q0589-lgart,
betrg04 TYPE q0589-betrg,
anzhl04 TYPE q0589-anzhl,
lga05 TYPE q0589-lgart,
betrg05 TYPE q0589-betrg,
anzhl05 TYPE q0589-anzhl,
lga06 TYPE q0589-lgart,
betrg06 TYPE q0589-betrg,
anzhl06 TYPE q0589-anzhl,
lga07 TYPE q0589-lgart,
betrg07 TYPE q0589-betrg,
anzhl07 TYPE q0589-anzhl,
lga08 TYPE q0589-lgart,
betrg08 TYPE q0589-betrg,
anzhl08 TYPE q0589-anzhl,
END OF type_s_it0589.
Work variables
DATA:
w_file TYPE string, " File Name
w_betrg(50) TYPE c, " Proposed Contribution
w_anzhl(50) TYPE c, " Actual Contribution
w_count(2) TYPE n, " Counter
w_year(4) TYPE n, " Year
w_month(2) TYPE n, " Month
w_day(2) TYPE n, " Day
w_date(10) TYPE c, " Date
w_wage(50) TYPE c, " wage
w_waget(50) TYPE c, " wage type
w_curr(12) TYPE c, " Currency
w_tabrows LIKE sy-srows VALUE 7, " Table Control rows
w_update TYPE i, " Number of Updated Records
w_failed TYPE i, " Number of Failed Records
w_0589_lines TYPE i, " Number of Records in File
w_text TYPE string. " CheckBox for considering
" Actual Contributions
Structure to hold File Data *
DATA :
fs_it0589 TYPE type_s_it0589.
Structure to hold Batch input: New table field structure *
DATA :
fs_bdcdata TYPE bdcdata.
Structure to hold Messages in the SAP System *
DATA :
fs_messages TYPE bdcmsgcoll.
Structure to hold Personnel Number, Message Type & Message Text *
DATA:
BEGIN OF fs_log,
pernr TYPE rp50g-pernr,
msgtxt(200) TYPE c,
msgtyp TYPE c,
END OF fs_log.
Structure to hold Parameter string for runtime of CALL TRANSACTION *
DATA :
fs_opt TYPE ctu_params.
Internal Table to hold File Data *
DATA :
t_it0589 LIKE
STANDARD TABLE
OF fs_it0589.
Internal Table to hold Batch input: New table field structure *
DATA :
t_bdcdata TYPE
STANDARD TABLE
OF bdcdata.
Internal Table to hold Messages in the SAP System *
DATA:
t_messages TYPE TABLE OF bdcmsgcoll.
Internal Table to hold Personnel Number, Message Type & Message Text*
DATA:
t_log LIKE
STANDARD TABLE
OF fs_log.
FORM validate .
IF p_file IS INITIAL.
MESSAGE e005(zvalid).
ENDIF. " IF P_FILE IS INITIAL.
MOVE p_file TO w_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_file
filetype = 'ASC'
has_field_separator = 'X'
dat_mode = 'X'
TABLES
data_tab = t_it0589
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 NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF t_it0589 IS INITIAL.
MESSAGE e006(zvalid).
ENDIF. " IF T_IT0589 IS INITIAL
ENDFORM. " FORM VALIDATE
FORM f4_help .
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
ENDFORM. " FORM F4_HELP
*& Form FILL_BDCDATA
FORM fill_bdcdata .
DESCRIBE TABLE t_it0589 LINES w_0589_lines.
LOOP AT t_it0589 INTO fs_it0589.
REFRESH t_bdcdata.
REFRESH t_messages.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'RP50G-PERNR'
fs_it0589-pernr.
w_year = fs_it0589-begda+0(4).
w_month = fs_it0589-begda+4(2).
w_day = fs_it0589-begda+6(2).
CONCATENATE w_day w_month w_year INTO w_date
SEPARATED BY '.'.
PERFORM bdc_field USING 'RP50G-BEGDA'
w_date.
w_year = fs_it0589-endda+0(4).
w_month = fs_it0589-endda+4(2).
w_day = fs_it0589-endda+6(2).
CONCATENATE w_day w_month w_year INTO w_date
SEPARATED BY '.'.
PERFORM bdc_field USING 'RP50G-ENDDA'
w_date.
PERFORM bdc_field USING 'RP50G-CHOIC'
fs_it0589-inftyp.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=INS'.
PERFORM bdc_dynpro USING 'MP058900' '2000'.
1st Row...............................................................
ADD 1 TO w_count.
MOVE fs_it0589-lga01 TO w_wage.
PERFORM bdc_field USING 'Q0589-LGART(01)'
w_wage.
MOVE fs_it0589-betrg01 TO w_curr.
PERFORM bdc_field USING 'Q0589-BETRG(01)'
w_curr.
MOVE fs_it0589-anzhl01 TO w_curr.
PERFORM bdc_field USING 'Q0589-ANZHL(01)'
w_curr.
2nd Row...............................................................
3rd Row...............................................................
4th Row...............................................................
5th Row...............................................................
6th Row...............................................................
ADD 1 TO w_count.
IF w_count > w_tabrows .
w_count = 1.
PERFORM bdc_field USING 'BDC_OKCODE'
'P+' .
PERFORM bdc_dynpro USING 'MP058900' '2000'.
ENDIF. " IF W_COUNT > W_TABROWS
MOVE fs_it0589-lga06 TO w_curr.
CONCATENATE 'Q0589-LGART(' w_count ')' INTO w_wage.
PERFORM bdc_field USING w_wage
w_curr.
MOVE fs_it0589-betrg06 TO w_curr.
CONCATENATE 'Q0589-BETRG(' w_count ')' INTO w_betrg.
PERFORM bdc_field USING w_betrg
w_curr.
MOVE fs_it0589-anzhl06 TO w_curr.
CONCATENATE 'Q0589-ANZHL(' w_count ')' INTO w_anzhl.
PERFORM bdc_field USING w_anzhl
w_curr.
7th Row...............................................................
ADD 1 TO w_count.
IF w_count > w_tabrows .
w_count = 1.
PERFORM bdc_field USING 'BDC_OKCODE'
'P+' .
PERFORM bdc_dynpro USING 'MP058900' '2000'.
ENDIF. " IF W_COUNT > W_TABROWS
MOVE fs_it0589-lga07 TO w_curr.
CONCATENATE 'Q0589-LGART(' w_count ')' INTO w_wage.
PERFORM bdc_field USING w_wage
w_curr.
MOVE fs_it0589-betrg07 TO w_curr.
CONCATENATE 'Q0589-BETRG(' w_count ')' INTO w_betrg.
PERFORM bdc_field USING w_betrg
w_curr.
MOVE fs_it0589-anzhl07 TO w_curr.
CONCATENATE 'Q0589-ANZHL(' w_count ')' INTO w_anzhl.
PERFORM bdc_field USING w_anzhl
w_curr.
*- -- Same upto 15 rows.......
Save..................................................................
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
Back..................................................................
PERFORM bdc_dynpro USING 'MP058900' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/EBCK'.
w_count = 0.
CALL TRANSACTION 'PA30' USING t_bdcdata
OPTIONS FROM fs_opt
MESSAGES INTO t_messages.
LOOP AT t_messages INTO fs_messages.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = fs_messages-msgid
lang = sy-langu
no = fs_messages-msgnr
v1 = fs_messages-msgv1
v2 = fs_messages-msgv2
v3 = fs_messages-msgv3
v4 = fs_messages-msgv4
IMPORTING
msg = fs_log-msgtxt
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF SY-SUBRC NE 0
MOVE fs_it0589-pernr TO fs_log-pernr.
MOVE fs_messages-msgtyp TO fs_log-msgtyp.
APPEND fs_log TO t_log.
CLEAR fs_log.
IF fs_messages-msgtyp EQ 'S'
AND fs_messages-msgnr EQ '102'.
ADD 1 TO w_update.
ELSEIF fs_messages-msgtyp EQ 'S'
AND fs_messages-msgnr EQ '015'
OR fs_messages-msgtyp EQ 'E'.
ADD 1 TO w_failed.
ENDIF. " IF FS_MESSAGES-MSGTYP EQ 'S'
ENDLOOP. " LOOP AT T_MESSAGES
ENDLOOP. " LOOP AT T_IT0585
WRITE :/ 'Number of Records Fetched from file'(001),
50 w_0589_lines COLOR 1,
/ 'Number of Records Updated into the database'(002),
50 w_update COLOR 1,
/ 'Number of Records Failed to update into database'(003),
50 w_failed COLOR 6 .
SKIP 3.
WRITE :/ 'Detailed Log.....'(004).
SKIP 1.
LOOP AT t_log INTO fs_log.
AT NEW pernr.
WRITE :/ fs_log-pernr COLOR 1.
ENDAT. " AT NEW PERNR
IF fs_log-msgtyp = 'E'.
WRITE :15 fs_log-msgtxt COLOR 6 INVERSE ON.
ELSE.
WRITE :15 fs_log-msgtxt.
ENDIF. " IF FS_LOG-MSGTYP = 'E'
ENDLOOP. " LOOP AT T_LOG INTO FS_LOG
ENDFORM. " FORM FILL_BDCDATA
*& Form BDC_DYNPRO
This subroutine starts new screen *
There are no interface parameters to be passed to this subroutine. *
FORM bdc_dynpro USING program dynpro.
CLEAR fs_bdcdata.
fs_bdcdata-program = program.
fs_bdcdata-dynpro = dynpro.
fs_bdcdata-dynbegin = 'X'.
APPEND fs_bdcdata TO t_bdcdata.
ENDFORM. " FORM BDC_DYNPRO
*& Form BDC_FIELD
This subroutine inserts field *
There are no interface parameters to be passed to this subroutine. *
FORM bdc_field USING fnam fval.
CLEAR fs_bdcdata.
fs_bdcdata-fnam = fnam.
fs_bdcdata-fval = fval.
APPEND fs_bdcdata TO t_bdcdata.
ENDFORM. " FORM BDC_FIELD
Thanks,
Ziad khanHi Amit,
Thaks for reply. Amit, I am new to ABAP-HR so i dont know how to use FM "HR_MAINTAIN_MASTERDATA".
Can u please explain in detail.
Thanks
Ziad -
Can we make a BDC program as a webservice
Hi All,
Can we write a BDC program in RFC Function Module and access it through web service.
We have a requirement to create a Return Order, for that we have recorded the Va01 transaction for return order and included the same recorded code in RFC Function module and also created web service for it. But when we tried to access through webservice, it is showing the following error
"Call to returned http code 500 (Internal Server Error) with unacceptable content type (text/html; charset=utf-8).
><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode> soap:Server </faultcode><faultstring xml:lang="en"> RABAX occurred on server side </faultstring><detail><sap:Rabax xmlns:sap="http://www.sap.com/webas/710/soap/runtime/abap/fault/generic"><MESSAGE>Access via 'NULL' object reference not possible.</MESSAGE><SYMSGID>VX</SYMSGID><SYMSGTY>S</SYMSGTY><SYMSGNO>206</SYMSGNO><SYMSGV1>TextEditControl</SYMSGV1><SYMSGV2></SYMSGV2><SYMSGV3></SYMSGV3><SYMSGV4></SYMSGV4><SYREPID>SAPLV70T</SYREPID><SYTCODE>VA01</SYTCODE><SYDYNNR>2000</SYDYNNR><SYUNAME>DIK</SYUNAME><SYMANDT>100</SYMANDT><SYLANGU>E</SYLANGU><SYECODE>558</SYECODE><SYHOST>sapdvp</SYHOST><SYSYSID>SD1</SYSYSID><SYOPSYS>Windows NT</SYOPSYS><SYDBSYS>MSSQL</SYDBSYS><SYSAPRL>700</SYSAPRL><SYXPROG>SAPCNVE</SYXPROG><SYXFORM>CONVERSION_EXIT</SYXFORM><SYDATUM>20111104</SYDATUM><SYUZEIT>153001</SYUZEIT><SYETEXT>RABAX_STATE</SYETEXT><ERRORCODE>OBJECTS_OBJREF_NOT_ASSIGNED</ERRORCODE><PATHTRANS>/sap/bc/srt/rfc/sap/zcom_create_return_bdc/100/zcom_create_return_bdc/zcom_create_return_bdc</PATHTRANS><MESSAGE>Access via 'NULL' object reference not possible.</MESSAGE><ERRORCODE>OBJECTS_OBJREF_NOT_ASSIGNED</ERRORCODE></sap:Rabax></detail></soap:Fault></soap:Body></soap:Envelope>"
When we execute the same RFC from SAP SE37 T-Code , it is working fine but same not working from web service .
One more thing If anybody knows the standard BAPI or Function Module to create the Sales Return Order please do post .
Thanks in advance ,
ChaitanyaHi Pranav,
Okay. Kindly let me know how to run rfc function module in background because we have call transaction perform in RFC function module and I am posting BDC code that is using inside RFC function module.
TYPES:BEGIN OF t_bdcdata,
program TYPE bdc_prog,
dynpro TYPE bdc_dynr,
dynbegin TYPE bdc_start,
fnam TYPE fnam_____4,
fval TYPE bdc_fval,
END OF t_bdcdata.
DATA:wa_bdcdata TYPE t_bdcdata,
it_bdcdata TYPE TABLE OF t_bdcdata.
DATA:auart_001 TYPE bdc_fval,
vkorg_002 TYPE bdc_fval,
vtweg_003 TYPE bdc_fval,
spart_004 TYPE bdc_fval,
vbeln_005 TYPE bdc_fval,
kunwe_006 TYPE bdc_fval,
bstkd_007 TYPE bdc_fval,
augru_010 TYPE bdc_fval,
bsark_011 TYPE bdc_fval,
augru_019 TYPE bdc_fval,
bsark_020 TYPE bdc_fval.
DATA:v_subrc TYPE sy-subrc.
MOVE auart TO auart_001.
MOVE vkorg TO vkorg_002.
MOVE vtweg TO vtweg_003.
MOVE spart TO spart_004.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = vbeln
IMPORTING
output = vbeln.
MOVE vbeln TO vbeln_005.
MOVE kunwe TO kunwe_006.
MOVE bstkd TO bstkd_007.
MOVE augru TO augru_010.
MOVE bsark TO bsark_011.
MOVE augru TO augru_019.
MOVE bsark TO bsark_020.
wa_bdcdata-program = 'SAPMV45A'.
wa_bdcdata-dynpro = '0101'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'VBAK-AUART'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=COPY'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'VBAK-AUART'.
wa_bdcdata-fval = auart_001.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'VBAK-VKORG'.
wa_bdcdata-fval = vkorg_002.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'VBAK-VTWEG'.
wa_bdcdata-fval = vtweg_003.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'VBAK-SPART'.
wa_bdcdata-fval = spart_004.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPLV45C'.
wa_bdcdata-dynpro = '0100'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=UEBR'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'LV45C-VBELN'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'LV45C-VBELN'.
wa_bdcdata-fval = vbeln_005.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPLJ3AD'.
wa_bdcdata-dynpro = '2010'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=ENT1'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'J_3ASZFH-BSTKD'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-KUNWE'.
wa_bdcdata-fval = kunwe_006.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-BSTKD'.
wa_bdcdata-fval = bstkd_007.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-AUGRU'.
wa_bdcdata-fval = augru_010.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-BSARK'.
wa_bdcdata-fval = bsark_011.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-program = 'SAPLJ3AD'.
wa_bdcdata-dynpro = '2010'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_OKCODE'.
wa_bdcdata-fval = '=SICH'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'BDC_CURSOR'.
wa_bdcdata-fval = 'J_3ASZFH-BSTKD'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-AUGRU'.
wa_bdcdata-fval = augru_019.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'J_3ASZFH-BSARK'.
wa_bdcdata-fval = bsark_020.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
EXPORTING
tcode = 'VA01'
skip_screen = ''
mode_val = 'N'
update_val = 'A'
IMPORTING
subrc = subrc
TABLES
using_tab = it_bdcdata
SPAGPA_TAB =
mess_tab = messtab
EXCEPTIONS
call_transaction_denied = 1
tcode_invalid = 2
OTHERS = 3
IF sy-subrc <> 0.
subrc = sy-subrc.
EXIT.
ENDIF.
so i am using BDC code to create order instead of function module and converted bdccode into rfc function module,
just help how to do with above code.
With Regards,
Krishna Chaitanya -
Problem with creating BDC program
Hi All,
I was trying to create a BDC program for transaction SE63 (language translation). I am doing it for text modules translation. For this, screen contains two fields, one is source language and another is target language and both are input disabled. We can input entries only through F4 help.
Now the problem is while doing recording through transaction SHDB, it is not recognizing the F4 help and so i am not able to make any entry in that through BDC. Since field is input disabled so I can not make the entries directly.
Can anyone please help me, how to make entries in this type of field through BDC?
Regards,
AkhilThanks Keshav for your valueble reply but this function module is giving me error saying go to SE63 for translation. Can you mull over any other option and suggest me the same.
-
Dialog Box Problem in BDC Program...
Hi friends,
I am facing a problem while creating service entry sheet no throgh bdc ( Tcode ML81N) . I use 'no disply' mode in call transaction method.
whenever i regarding in our development client there is no dialog box with the following screen. But in QAS server it displays the same. I have already include the following code in my bdc program. But the dialog box been displayed finally. Our user doesn't require this interaction. Kindly give solutions.
perform bdc_dynpro using 'SAPLMLSR' '0110'.
perform bdc_field using 'BDC_CURSOR'
'IMKPF-BLDAT'.
perform bdc_field using 'BDC_OKCODE'
'=OK'.
perform bdc_transaction using 'ML81N'.
Thanks & Regards,
SP.Manavalan.Hi,
Thanks for reply.
I have checked log using SM37, it is not showing any error.
Log details are as follows...
Date Time Message text Message class Message no. Messag
08.05.2010 11:47:10 Job started 00 516 S
08.05.2010 11:47:10 Step 001 started (program ZSDB_J1I5_REG_UPDATE_BDC, variant 1101_1_RMA, user ID STK) 00 550 S
08.05.2010 11:47:20 Job finished 00 517 S
Maybe you are looking for
-
Hi, we installed a additional dialog instance for our entprise portal. the instance is up&running, but no one is connected. i can manage the instance in the config tool and added 3 servers. do i have to set up a additional web dispatcher? - like me
-
How to use the Oracle AQ JMS API using Toplink
My application is using AQ using PL/SQL. We want to convert the PL/SQL code to the JMS interface Oracle offers, the problem is that I need to use a java.sql.Connection object in order to connect to the AQ. I don't own the java.sql.Connection in Topli
-
Is there some way to inhibit top posting when composing a message in Mail (Leopard)? Top posting places your reply text above the quoted text, which means you have to scroll to the bottom and read up to follow a thread of the messages being quoted. T
-
after updating i lost alll settings in phone. nw showing recovery mode, then i try to recover it but after some process its showing error 1015 what to do?
-
BT it seems is a terrific technical and innovation organisation but communication with BT is so complex. Kafkaesque is a good word for describing the bureaucracy. Or maybe I just can see the obvious. In any case, I am keen to use BT broadband while a