Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC issue

Former Member
0 Likes
1,548

Hi Gurus, for the follwoing code after I start the session method, after the first screen it is throwing me an error saying "no batch input screen for sapv45ma 4001", and it is not taking any values from here on. Here is the code:

report ZSO_BDC1

no standard page heading line-size 255.

include bdcrecx1.

data: begin of record occurs 1,

auart(4) type c,

vkorg(4) type c,

vtweg(2) type c,

spart(2) type c,

kunnr(10) type c,

kunnr3(10) type c,

mabnr(18) type c,

kwmeng(15) type c,

kunnr4(10) type c,

kunnr5(10) type c,

zterm2(4) type c,

inco5(3) type c,

inco6(28) type c,

kwmeng1(15) type c,

vrkme(4) type c,

kschl(4) type c,

kbetr(11) type c,

bedat(8) type c,

kunnr1(10) type c,

kunnr2(10) type c,

zterm1(4) type c,

inco3(3) type c,

inco4(28) type c,

end of record.

*data record like bdcdata occurs 2 with header line.

start-of-selection.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'D:\open_so.txt'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • VIRUS_SCAN_PROFILE =

  • NO_AUTH_CHECK = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = RECORD

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_READ_ERROR = 2

  • NO_BATCH = 3

  • GUI_REFUSE_FILETRANSFER = 4

  • INVALID_TYPE = 5

  • NO_AUTHORITY = 6

  • UNKNOWN_ERROR = 7

  • BAD_DATA_FORMAT = 8

  • HEADER_NOT_ALLOWED = 9

  • SEPARATOR_NOT_ALLOWED = 10

  • HEADER_TOO_LONG = 11

  • UNKNOWN_DP_ERROR = 12

  • ACCESS_DENIED = 13

  • DP_OUT_OF_MEMORY = 14

  • DISK_FULL = 15

  • DP_TIMEOUT = 16

  • OTHERS = 17

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

perform open_group.

loop at record.

  • clear record.

  • refresh record.

perform bdc_dynpro using 'SAPMV45A' '0101'.

perform bdc_field using 'BDC_CURSOR'

'VBAK-VKGRP'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'VBAK-AUART'

record-auart.

perform bdc_field using 'VBAK-VKORG'

record-vkorg.

perform bdc_field using 'VBAK-VTWEG'

record-vtweg.

perform bdc_field using 'VBAK-SPART'

record-spart.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'KUAGV-KUNNR'

record-kunnr.

perform bdc_field using 'KUWEV-KUNNR'

record-kunnr3.

*perform bdc_field using 'RV45A-KETDAT'.

*perform bdc_field using 'RV45A-KPRGBZ'.

*perform bdc_field using 'VBKD-PRSDT'.

perform bdc_field using 'BDC_CURSOR'

'RV45A-KWMENG(01)'.

perform bdc_field using 'RV45A-MABNR(01)'

record-mabnr.

perform bdc_field using 'RV45A-KWMENG(01)'

record-kwmeng.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'=ITEM'.

perform bdc_field using 'KUAGV-KUNNR'

record-kunnr4.

perform bdc_field using 'KUWEV-KUNNR'

record-kunnr5.

*perform bdc_field using 'RV45A-KETDAT'.

*perform bdc_field using 'RV45A-KPRGBZ'.

*perform bdc_field using 'VBKD-PRSDT'.

perform bdc_field using 'VBKD-ZTERM'

record-zterm2.

perform bdc_field using 'VBKD-INCO1'

record-inco5.

perform bdc_field using 'VBKD-INCO2'

record-inco6.

perform bdc_field using 'BDC_CURSOR'

'RV45A-MABNR(01)'.

perform bdc_dynpro using 'SAPMV45A' '4003'.

perform bdc_field using 'BDC_OKCODE'

'=T\06'.

perform bdc_field using 'BDC_CURSOR'

'RV45A-KWMENG'.

perform bdc_field using 'RV45A-KWMENG'

record-kwmeng1.

perform bdc_field using 'VBAP-VRKME'

record-vrkme.

*perform bdc_field using 'RV45A-ETDAT'

*perform bdc_field using 'RV45A-PRGBZ'

*perform bdc_field using 'VBKD-PRSDT'

perform bdc_dynpro using 'SAPMV45A' '5003'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'KOMV-KBETR(07)'.

perform bdc_field using 'KOMV-KSCHL(07)'

record-kschl.

perform bdc_field using 'KOMV-KBETR(07)'

record-kbetr.

perform bdc_dynpro using 'SAPMV45A' '5003'.

perform bdc_field using 'BDC_OKCODE'

'=T\05'.

perform bdc_field using 'BDC_CURSOR'

'KOMV-KSCHL(08)'.

perform bdc_dynpro using 'SAPLCNMS' '1300'.

perform bdc_field using 'BDC_OKCODE'

'/EESC'.

perform bdc_field using 'BDC_CURSOR'

'MLSTS-AUFNR'.

perform bdc_dynpro using 'SAPLV60F' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'FPLT-AFDAT(01)'.

perform bdc_field using 'FPLA-BEDAT'

record-bedat.

*perform bdc_field using 'FPLA-BEDAR'

.

*perform bdc_field using 'FPLT-AFDAT(01)'

perform bdc_dynpro using 'SAPLV60F' '4001'.

perform bdc_field using 'BDC_OKCODE'

'=S\BACK'.

perform bdc_field using 'BDC_CURSOR'

'FPLA-BEDAT'.

*perform bdc_field using 'FPLA-BEDAT'

*perform bdc_field using 'FPLA-BEDAR'

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_field using 'KUAGV-KUNNR'

record-kunnr1.

perform bdc_field using 'KUWEV-KUNNR'

record-kunnr2.

*perform bdc_field using 'RV45A-KETDAT'

*perform bdc_field using 'RV45A-KPRGBZ'

*perform bdc_field using 'VBKD-PRSDT'

perform bdc_field using 'VBKD-ZTERM'

record-zterm1.

perform bdc_field using 'VBKD-INCO1'

record-inco3.

perform bdc_field using 'VBKD-INCO2'

record-inco4.

perform bdc_field using 'BDC_CURSOR'

'RV45A-MABNR(02)'.

perform bdc_transaction using 'VA01'.

endloop.

perform close_group.

Please let me know the changes.

Thanks and Regards,

Vishwa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,320

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

change the following code

to the below

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'/00.

8 REPLIES 8
Read only

Former Member
0 Likes
1,320

Hi!

Try to run your batch session in foreground. Then you will see the dynpro which does not have data. They are mostly some kind of unwanted popup windows.

Or you can check out the dynpro with the SE51 transaction.

This dynpro might be swapped with an another dynpro in your program, or missing from it.

Regards

Tamá

Read only

Former Member
0 Likes
1,321

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

change the following code

to the below

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'/00.

Read only

0 Likes
1,320

Hi PBS,

I made the changes as said by you. But the same thing is happening again. Any other suggestions please.

Thanks and Regards,

Vishwa.

Read only

0 Likes
1,320

HI,

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'09/14'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

Comment out these statements and try once,

I have a BDC program for Order creation,

if you want i can send it to you,

tell me your id,

reward if useful.

thanks and regards,

muralidhar.

Read only

Former Member
0 Likes
1,320

Hi,

Change your code...

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_CURSOR'

'RV45A-MABNR(01)'.

perform bdc_field using 'BDC_OKCODE' '/00'.

And also check is there any field that you are passing with intial values in the screen 4001.

Add this addition before the below statement.....

perform bdc_field using 'RV45A-KWMENG(01)'

record-kwmeng.

-


>

lv_char = record-kwmeng.

perform bdc_field using 'RV45A-KWMENG(01)'

record-kwmeng.

Rgds,

Bujji

Read only

Former Member
0 Likes
1,320

Hi,

I assume you are trying to create sales documents via VA01?

I'd suggest it would be better to use BAPI_SALESORDER_CREATEFROMDAT2 function module instead of calling a BDC - it's easier to work with and better practice.

Gareth.

Read only

Former Member
0 Likes
1,320

Hi,

If above is your full code then missed to copy the two sub-routines namely :

perform bdc_dynpro ........ .

perform bdc_field .......... .

Below is the two forms :

*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
form bdc_dynpro using program dynpro.
  clear <work-area name>.
  <work-area name>-program  = program.
  <work-area name>-dynpro   = dynpro.
  <work-area name>-dynbegin = 'X'.
  append <work-area name> to <internal table name>.
endform.                    "bdc_dynpro

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
  if not fval is initial.
    clear <work-area name>.
    <work-area name>-fnam = fnam.
    <work-area name>-fval = fval.
    append <work-area name> to <internal table name>.
  endif.
endform.                    "bdc_field

Regards,

Raghu

Read only

0 Likes
1,320

Hi Murali,

Thanks for the reply. If you click on my username,you will get my id. Please send it to the id mentioned there.

Thanks and Regards,

Vishwa.