‎2006 Jul 03 10:07 AM
Hi,
For data migration, I'm generating programs using recordings in SHDB,after making nescessary changes, when I run the script, I'm getting error 'Start screen does not exist in batch input data'.
It has happened with 2/3 BDCs. I didn't get the error.Please help.
Useful answers will be rewarded.
‎2006 Jul 06 4:09 PM
‎2006 Jul 03 10:31 AM
Hi Abhijit,
can you tell me on wich TA do you have Problems.
Regards, Dieter
‎2006 Jul 03 10:40 AM
‎2006 Jul 03 11:07 AM
Hi Abhijit,
i try it with KP06 an i have no Problems.
The Code is:
...
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(14)'.
perform bdc_field using 'BDC_OKCODE'
'=CSUB'.
perform bdc_field using 'KPP1B-ONLY'
record-ONLY_001.
perform bdc_field using 'KPP0B-VALUE(01)'
record-VALUE_01_002.
perform bdc_field using 'KPP0B-VALUE(02)'
record-VALUE_02_003.
perform bdc_field using 'KPP0B-VALUE(03)'
record-VALUE_03_004.
perform bdc_field using 'KPP0B-VALUE(04)'
record-VALUE_04_005.
perform bdc_field using 'KPP0B-VALUE(06)'
record-VALUE_06_006.
perform bdc_field using 'KPP0B-VALUE(11)'
record-VALUE_11_007.
perform bdc_field using 'KPP0B-VALUE(14)'
record-VALUE_14_008.
perform bdc_dynpro using 'SAPLKPP2' '0112'.
perform bdc_field using 'BDC_CURSOR'
'BDC01(01)'.
perform bdc_field using 'BDC_OKCODE'
'=CZUR'.
perform bdc_dynpro using 'SAPLKPP0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'KPP0B-VALUE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=CZUR'.
perform bdc_field using 'KPP1B-ONLY'
record-ONLY_009.
perform bdc_transaction using 'KP06'.
...
Do you have update the Code? Wich Release do you have?
Try KP06 without SHDB and test Dynpros- an Report-Number
and the defaults.
Regards, Dieter
‎2006 Jul 03 11:33 AM
Hi Dieter,
Thanks for the inputs.I've similar code.Program name and screen numbers are same and so are fields.I'm using 4.7 and I'm facing this problem recently for all the BDCs I'm developing.After registering your problem, I've started working on another BDC but stuck with sme issue.
‎2006 Jul 03 1:15 PM
Hi Abhijit,
i have test it under several releases (46C, ecc5) and have no Problems.
Are there any importing changes in Your System?
Any changes in Authorities?
Perhaps some INCLUDE has been changed?
Can you give me a Programm where you have Problems?
Regards, Dieter.
‎2006 Jul 04 6:53 AM
Hi Dieter,
I'm using standard bdc include and I've compared the screens.I'm attaching both the source codes.Please see if you can find something.
Thanks for sparing time for my problem.
KP06 Data Upload Program
=============================
REPORT zcorbic_coeinput_up
NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
DATA: BEGIN OF record OCCURS 0,
start(001), "X> Start of new Record
versn(003), "Version
perbl(003), "From Period
perbl_01(003), "To Period
gjahr(004), "Year
kostl(010), "Cost Center
lstar(006), "Activity Type
kstar(010), "Cost Element
bdc03(032), "Plan Fixed Cost
bdc05(032), "Plan Var Cost
bdc07(032), "Plan Fixed Consumption
bdc09(032), "Plan Variable Consumption
end(001), "X> End of Record
END OF record.
DATA: l_text(50),
count(02).
End generated data section ***
data file type string.
selection-screen: begin of block blk1 with frame.
parameters: p_file type rlgrap-filename obligatory
default 'C:\UPLOAD_PRODVER.TXT'.
parameters: err_file type rlgrap-filename obligatory
default 'C:\ERR_VER.TXT' .
selection-screen: end of block blk1.
Help Browser for File
at selection-screen on value-request for p_file.
perform f_get_file_name using p_file.
Help Browser for Error File
at selection-screen on value-request for err_file.
perform f_get_file_name using err_file.
Check for file name for File
START-OF-SELECTION.
file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
FILETYPE = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
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.
PERFORM bdc_dynpro USING 'SAPLSPO4' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'SVALD-VALUE(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FURT'.
PERFORM bdc_field USING 'SVALD-VALUE(01)'
'KBX'.
LOOP AT record.
IF record-start = 'X'.
PERFORM bdc_dynpro USING 'SAPLKPP0' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KPP0B-FORPL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=CSUB'.
PERFORM bdc_field USING 'KPP1B-ONLY'
' '.
PERFORM bdc_field USING 'KPP1B-FORPL'
'X'.
PERFORM bdc_field USING 'KPP0B-VALUE(01)'
record-versn.
PERFORM bdc_field USING 'KPP0B-VALUE(02)'
record-perbl.
PERFORM bdc_field USING 'KPP0B-VALUE(03)'
record-perbl_01.
PERFORM bdc_field USING 'KPP0B-VALUE(04)'
record-gjahr.
PERFORM bdc_field USING 'KPP0B-VALUE(06)'
record-kostl.
PERFORM bdc_field USING 'KPP0B-VALUE(09)'
record-lstar.
PERFORM bdc_field USING 'KPP0B-VALUE(12)'
record-kstar.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLKPP2' '0112'.
count = count + 1.
IF count < 0.
CONCATENATE '0' count INTO count.
ENDIF.
PERFORM form_fieldname USING 'Z-BDC07(' count
CHANGING l_text.
PERFORM bdc_field USING 'BDC_CURSOR'
l_text.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM form_fieldname USING 'Z-BDC03(' count
CHANGING l_text.
PERFORM bdc_field USING l_text
record-bdc03.
PERFORM form_fieldname USING 'Z-BDC05(' count
CHANGING l_text.
PERFORM bdc_field USING l_text
record-bdc05.
PERFORM form_fieldname USING 'Z-BDC07(' count
CHANGING l_text.
PERFORM bdc_field USING l_text
record-bdc07.
PERFORM form_fieldname USING 'Z-BDC09(' count
CHANGING l_text.
PERFORM bdc_field USING l_text
record-bdc09.
IF record-end = 'X'.
PERFORM bdc_dynpro USING 'SAPLKPP2' '0112'.
PERFORM bdc_field USING 'BDC_CURSOR'
l_text.
PERFORM bdc_field USING 'BDC_OKCODE'
'=CBUC'.
CALL TRANSACTION 'KP06' USING record MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
ENDIF.
ENDLOOP.
&----
*& Form form_fieldname
&----
text
----
-->P_FIELD text
-->P_COUNT text
<--P_FIELDNAME text
----
form form_fieldname using p_field
p_count
changing p_fieldname.
clear p_fieldname.
concatenate p_field p_count ')' into p_fieldname.
endform. " form_fieldname
----
FORM f_get_file_name *
----
........ *
----
--> P_FILE *
----
form f_get_file_name using p_file.
call function 'WS_FILENAME_GET'
exporting
mask = ',.,..'
importing
filename = p_file
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
endform. " f_get_file_name
----
FORM f_check_file_exist *
----
........ *
----
--> P_FILE_NAME *
----
form f_check_file_exist using p_file_name .
data: l_file_name like rlgrap-filename.
Check file exist at work station or not.
call function 'GUI_GET_FILE_INFO'
exporting
fname = p_file_name
exceptions
fileinfo_error = 1
others = 2.
if sy-subrc <> 0.
message e001(zbdc_msg).
endif.
endform. " f_check_file_exist
BDCRECX1 Include
=====================
***INCLUDE BDCRECX1.
for programs doing a data transfer by creating a batch-input session
and
for programs doing a data transfer by CALL TRANSACTION USING
selection-screen begin of line.
parameters session radiobutton group ctu. "create session
selection-screen comment 3(20) text-s07 for field session.
selection-screen position 45.
parameters ctu radiobutton group ctu. "call transaction
selection-screen comment 48(20) text-s08 for field ctu.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s01 for field group.
selection-screen position 25.
parameters group(12). "group name of session
selection-screen comment 48(20) text-s05 for field ctumode.
selection-screen position 70.
parameters ctumode like ctu_params-dismode default 'N'.
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s02 for field user.
selection-screen position 25.
parameters: user(12) default sy-uname. "user for session in batch
selection-screen comment 48(20) text-s06 for field cupdate.
selection-screen position 70.
parameters cupdate like ctu_params-updmode default 'L'.
"S: synchronously
"A: asynchronously
"L: local
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s03 for field keep.
selection-screen position 25.
parameters: keep as checkbox. "' ' = delete session if finished
"'X' = keep session if finished
selection-screen comment 48(20) text-s09 for field e_group.
selection-screen position 70.
parameters e_group(12). "group name of error-session
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 3(20) text-s04 for field holddate.
selection-screen position 25.
parameters: holddate like sy-datum.
selection-screen comment 51(17) text-s02 for field e_user.
selection-screen position 70.
parameters: e_user(12) default sy-uname. "user for error-session
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 51(17) text-s03 for field e_keep.
selection-screen position 70.
parameters: e_keep as checkbox. "' ' = delete session if finished
"'X' = keep session if finished
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 51(17) text-s04 for field e_hdate.
selection-screen position 70.
parameters: e_hdate like sy-datum.
selection-screen end of line.
selection-screen skip.
selection-screen begin of line.
selection-screen comment 1(33) text-s10 for field nodata.
parameters: nodata default '/' lower case. "nodata
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(33) for field smalllog.
parameters: smalllog as checkbox. "' ' = log all transactions
"'X' = no transaction logging
selection-screen end of line.
----
data definition
----
Batchinputdata of single transaction
data: bdcdata like bdcdata occurs 0 with header line.
messages of call transaction
data: messtab like bdcmsgcoll occurs 0 with header line.
error session opened (' ' or 'X')
data: e_group_opened.
message texts
tables: t100.
----
at selection screen *
----
at selection-screen.
group and user must be filled for create session
if session = 'X' and
group = space or user = space.
message e613(ms).
endif.
----
open dataset *
----
form open_dataset using p_dataset.
open dataset p_dataset
for input in text mode
encoding default.
if sy-subrc <> 0.
write: / text-e00, sy-subrc.
stop.
endif.
endform.
----
close dataset *
----
form close_dataset using p_dataset.
close dataset p_dataset.
endform.
----
create batchinput session *
(not for call transaction using...) *
----
form open_group.
if session = 'X'.
skip.
write: /(20) 'Create group'(i01), group.
skip.
open batchinput group
call function 'BDC_OPEN_GROUP'
exporting client = sy-mandt
group = group
user = user
keep = keep
holddate = holddate.
write: /(30) 'BDC_OPEN_GROUP'(i02),
(12) 'returncode:'(i05),
sy-subrc.
endif.
endform.
----
end batchinput session *
(call transaction using...: error session) *
----
form close_group.
if session = 'X'.
close batchinput group
call function 'BDC_CLOSE_GROUP'.
write: /(30) 'BDC_CLOSE_GROUP'(i04),
(12) 'returncode:'(i05),
sy-subrc.
else.
if e_group_opened = 'X'.
call function 'BDC_CLOSE_GROUP'.
write: /.
write: /(30) 'Fehlermappe wurde erzeugt'(i06).
endif.
endif.
endform.
----
Start new transaction according to parameters *
----
form bdc_transaction using tcode.
data: l_mstring(480).
data: l_subrc like sy-subrc.
batch input session
if session = 'X'.
call function 'BDC_INSERT'
exporting tcode = tcode
tables dynprotab = bdcdata.
if smalllog <> 'X'.
write: / 'BDC_INSERT'(i03),
tcode,
'returncode:'(i05),
sy-subrc,
'RECORD:',
sy-index.
endif.
call transaction using
else.
refresh messtab.
call transaction tcode using bdcdata
mode ctumode
update cupdate
messages into messtab.
l_subrc = sy-subrc.
if smalllog <> 'X'.
write: / 'CALL_TRANSACTION',
tcode,
'returncode:'(i05),
l_subrc,
'RECORD:',
sy-index.
loop at messtab.
select single * from t100 where sprsl = messtab-msgspra
and arbgb = messtab-msgid
and msgnr = messtab-msgnr.
if sy-subrc = 0.
l_mstring = t100-text.
if l_mstring cs '&1'.
replace '&1' with messtab-msgv1 into l_mstring.
replace '&2' with messtab-msgv2 into l_mstring.
replace '&3' with messtab-msgv3 into l_mstring.
replace '&4' with messtab-msgv4 into l_mstring.
else.
replace '&' with messtab-msgv1 into l_mstring.
replace '&' with messtab-msgv2 into l_mstring.
replace '&' with messtab-msgv3 into l_mstring.
replace '&' with messtab-msgv4 into l_mstring.
endif.
condense l_mstring.
write: / messtab-msgtyp, l_mstring(250).
else.
write: / messtab.
endif.
endloop.
skip.
endif.
Erzeugen fehlermappe ************************************************
if l_subrc <> 0 and e_group <> space.
if e_group_opened = ' '.
call function 'BDC_OPEN_GROUP'
exporting client = sy-mandt
group = e_group
user = e_user
keep = e_keep
holddate = e_hdate.
e_group_opened = 'X'.
endif.
call function 'BDC_INSERT'
exporting tcode = tcode
tables dynprotab = bdcdata.
endif.
endif.
refresh bdcdata.
endform.
----
Start new screen *
----
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform.
----
Insert field *
----
form bdc_field using fnam fval.
if fval <> nodata.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endif.
endform.
‎2006 Jul 06 8:50 AM
Hi Abhijit,
I think your:
CALL TRANSACTION 'KP06' USING record MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
has to be:
CALL TRANSACTION 'KP06' USING <b>BDCDATA</b> MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
Regards, Dieter
‎2006 Jul 06 4:09 PM
‎2006 Jul 07 12:08 PM
Hi Dieter,
Thank you very much for your help.I've done the needful.