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: selection screen error

Former Member
0 Likes
2,038

HI,

In the bdc program, after uploading a file in the selection screen using parameter selection, the screen gets refrehed and returns to the selection screen with no further action. How do I solve this error?

21 REPLIES 21
Read only

GauthamV
Active Contributor
0 Likes
2,000

hi,

check if you are using session method in your program.

if it is the case then a session will be created in SM35 transaction.check there.

Read only

Former Member
0 Likes
2,000

Hi,

What is transaction code for which you are writing a BDC.

May be it has failed the validation, so its coming back to initial screen.

Thanks & Regards,

Navneeth K.

Read only

0 Likes
2,000

its for transaction 'VA01'

Read only

Former Member
0 Likes
2,000

Hi

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_flie TYPE localfile.

PARAMETERS: p_mode TYPE ctu_mode OBLIGATORY DEFAULT 'A' MODIF ID ch3.

SELECTION-SCREEN : END OF BLOCK b1.

In ur code u have declare file selection

FM: f4_filename

or

KD_GET_FILENAME_ON_F4

After u have to upload the file

Regrads:

Prabu

Read only

0 Likes
2,000

i have declared f4_filename

Read only

Former Member
0 Likes
2,000

first debugg the program. or

if code is small then paste here

Read only

0 Likes
2,000

&----


*& Report ZSALES2

*&

&----


*&

*&

&----


REPORT ZSALES2.

tables:VBAK,

vbkd,

kuagv,

rv45a,

vbap.

types :begin of t_records,

AUART type VBAK-AUART,

BSTKD type VBKD-BSTKD,

BSTDK type VBKD-BSTDK,

KUNNR type KUAGV-KUNNR,

KETDAT type RV45A-KETDAT,

KPRGBZ type RV45A-KPRGBZ,

PRSDT type VBKD-PRSDT,

ZTERM type VBKD-ZTERM,

MABNR type RV45A-MABNR,

KWMENG type RV45A-KWMENG,

POSNR type VBAP-POSNR,

end of t_records.

data: it_records type table of t_records,

wa_records type t_records.

DATA : BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.

PARAMETERS : P_FILE LIKE RLGRAP-FILENAME.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

PERFORM GET_FILE.

start-of-selection.

PERFORM GET_DATA.

PERFORM BDCDATA.

&----


*& Form GET_FILE

&----


  • text

----


form GET_FILE .

CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • PROGRAM_NAME = SYST-CPROG

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

FILE_NAME = P_FILE.

endform. " GET_FILE

form GET_DATA.

DATA:V_FILE TYPE STRING.

V_FILE = P_FILE.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = V_FILE

FILETYPE = 'DAT'

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 = it_records

  • 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. " GET_DATA.

form BDCDATA.

loop at it_records into wa_records.

*CALL TRANSCATION "VA01" USING BDCDATA.

perform bdc_dynpro using 'SAPMV45A' '0101'.

perform bdc_field using 'BDC_CURSOR'

'VBAK-SPART'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'VBAK-AUART'

'OR'.

perform bdc_field using 'VBAK-VKORG'

''.

perform bdc_field using 'VBAK-VTWEG'

''.

perform bdc_field using 'VBAK-SPART'

''.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'07/12'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'VBKD-BSTKD'.

perform bdc_field using 'VBKD-BSTKD'

'123'.

perform bdc_field using 'VBKD-BSTDK'

'08.10.2008'.

perform bdc_field using 'KUAGV-KUNNR'

'31970063'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'04/21'.

perform bdc_field using 'BDC_OKCODE'

'PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'RV45A-KETDAT'

'08.10.2008'.

perform bdc_field using 'RV45A-KPRGBZ'

'D'.

perform bdc_field using 'VBKD-PRSDT'

'08.10.2008'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'VBKD-ZTERM'

'0001'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'06/11'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'VBKD-BSTKD'

'123'.

perform bdc_field using 'VBKD-BSTDK'

'08.10.2008'.

perform bdc_field using 'KUAGV-KUNNR'

'31970063'.

perform bdc_field using 'KUWEV-KUNNR'

'31970063'.

perform bdc_field using 'RV45A-KETDAT'

'08.10.2008'.

perform bdc_field using 'RV45A-KPRGBZ'

'D'.

perform bdc_field using 'VBKD-PRSDT'

'08.10.2008'.

perform bdc_field using 'VBKD-ZTERM'

'0001'.

perform bdc_field using 'BDC_CURSOR'

'RV45A-KWMENG(01)'.

perform bdc_field using 'RV45A-MABNR(01)'

'102'.

perform bdc_field using 'RV45A-KWMENG(01)'

' 5'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'05/08'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'RV45A-MABNR(01)'

'83'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'16/04'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'RV45A-MABNR(01)'

'121'.

perform bdc_field using 'VBAP-POSNR(01)'

' 1'.

perform bdc_dynpro using 'SAPMV45A' '4001'.

perform bdc_field using 'BDC_OKCODE'

'/EBAC1'.

perform bdc_field using 'BDC_CURSOR'

'RV45A-MABNR(01)'.

perform bdc_transaction using 'VA01' .

CALL TRANSCATION 'VA01' USING BDCDATA.

ENDLOOP.

endform. "BDCDATA

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.

&----


*& Form BDC_TRANSACTION

&----


  • text

----


  • -->P_0428 text

----


form BDC_TRANSACTION using value(p_0428).

endform. " BDC_TRANSACTION

Read only

0 Likes
2,000

Are you sure your internal table it_records isn't empty?

By the way, use:

data: lt_message type table of BDCMSGCOLL.

CALL TRANSCATION 'VA01' USING BDCDATA
         mode 'A'
         update 'S'
         messages into lt_messages.

With mode A you will see all screens; as if you are doing the transaction, and you will need to press enter to process each BDC code / screen.

In lt_messages you will have all messages that were triggered during the VA01.

Read only

0 Likes
2,000

How are running the program Foreground or Background mode. In Foreground mode GUI_UPLOAD will not work.

Read only

0 Likes
2,000

>

> In Foreground mode GUI_UPLOAD will not work.

You mean background.

Read only

0 Likes
2,000

yes, i checked. the internal table is not empty. how do i check whether my program i srunning in foreground or background mode. if its in foreground then how should i solve my error?

Read only

0 Likes
2,000

mode 'A' -> processing in foreground

mode 'S' -> processing in background

Try mode 'A' and see if the transaction is triggered. And did you use the MESSAGES INTO? If there are any error messages, you will find them there.

This is the only way to find out any porblems that may occur. And when you fnd your problem, you can solve it,

And do F1 on statement CALL TRANSACTION

Read only

0 Likes
2,000

if i write the message using call transaction it gives a syntax error saying put "." or ID after transaction. If i put a perios after call transaction then it shows the obvious error as thre should be object after transaction.

I dont know how to check the a and s mode. its my first bdc program.

Read only

0 Likes
2,000

parameters: DIS_MODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.

CALL TRANSACTION 'KB15N' USING BDCDATA MODE DIS_MODE MESSAGES INTO MESSTAB .

Read only

0 Likes
2,000

>

> if i write the message using call transaction it gives a syntax error saying put "." or ID after transaction. If i put a perios after call transaction then it shows the obvious error as thre should be object after transaction.

> I dont know how to check the a and s mode. its my first bdc program.

There's a typo in my example: TRANSCATION. Obviously it should be TRANSACTION.

Read only

0 Likes
2,000

Sorry , Maen Anachronos i mean it wont work in background mode

Read only

0 Likes
2,000

it works now..but when the sales order opens, its empty!!! no data has been filled

Read only

0 Likes
2,000

Its generally not advisable to write BDCs for transactional data. Try to use BAPI for creating Sale Order its much easier and best way.

Read only

0 Likes
2,000

BAPI_SALESORDER_CREATEFROMDAT2

Edited by: Navneeth Bothra on Oct 10, 2008 11:35 AM

Read only

0 Likes
2,000

after debugging, the bdcdata table is empty

Read only

0 Likes
2,000

try to place a break point before call transaction is called and check whether data is present in bdcdata.