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

SESSION METHOD( WRONG VALUE OF THE parameter file type)

Former Member
0 Likes
495

Hi here iam sending the whole code once to you. just chk it once and same error(WRONG VALUE OF THE parameter file type) is coming after the changes.

if i use asc it is giving that no file exists.

*********************************************

Table Declaration

*********************************************

tables :rf02k, "Maintain vendor master record screen and work fields

lfa1, "Vendor Master(general)

lfbk, "Vendor Master (Bank Details)

lfb1, "Vendor Master (Company Code)

lfm1, "Vendor master record purchasing organization data

lfb5. "Vendor master (dunning data)

*********************************************

Data Declaration

*********************************************

data : begin of it_UPLOAD occurs 0,

LIFNR like rf02k-lifnr, "vendor no

BUKRS like rf02k-bukrs, "company code

EKorg like rf02k-ekorg, "purchasing org

KTOKK like rf02k-ktokk, "account group

anred like lfa1-anred, "initial

name1 like lfa1-name1, "name of vendor

sortl like lfa1-sortl, "search term

land1 like lfa1-land1, "country

akont like lfb1-akont, "reconcillation a/c.

fdgrv like lfb1-fdgrv, "planning group

zterm like lfb1-zterm, "terms of payment key

mahna like LFB5-MAHNA, "dunning procedure

waers like lfm1-waers, "Purchase order currency

END OF IT_UPLOAD.

DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

include bdcrecx1.

start-of-selection.

********************************************************

UPLOADING THE DATA TO IT_UPLOAD

********************************************************

call function 'GUI_UPLOAD'

exporting

filename = 'C:\DASRR\VENDOR1.TXT'

filetype = 'DAT'

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

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

*CALL FUNCTION 'GUI_UPLOAD'

  • EXPORTING

  • FILENAME = 'C:/VENDOR1.TXT'

  • FILETYPE = 'DAT'

  • TABLES

  • DATA_TAB = IT_UPLOAD.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'SRR'

USER = SY-UNAME.

  • POPULATE INTERNAL TABL

LOOP AT IT_UPLOAD.

CLEAR IT_BDCDATA.

REFRESH IT_BDCDATA.

PERFORM POPULATE_DATA.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'XK01'

TABLES

DYNPROTAB = IT_BDCDATA.

ENDLOOP.

&----


*& Form POPULATE_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM POPULATE_DATA .

PERFORM GETDATA USING 'X' 'SAPMF02K' '0100'.

perform getdata using ' ' RF02K-LIFNR 'IT_UPLOAD-LIFNR'.

perform getdata using ' ' RF02K-bukrs 'IT_UPLOAD-bukrs'.

perform getdata using ' ' RF02K-EKORG 'IT_UPLOAD-EKORG'.

perform getdata using ' ' RF02K-KTOKK 'IT_UPLOAD-KTOKK'.

PERFORM GETDATA USING 'X' 'SAPMF02K' '0110'.

perform getdata using ' ' LFA1-ANRED 'IT_UPLOAD-ANRED'.

perform getdata using ' ' LFA1-NAME1 'IT_UPLOAD-NAME1'.

perform getdata using ' ' LFA1-SORTL 'IT_UPLOAD-SORTL'.

perform getdata using ' ' LFA1-LAND1 'IT_UPLOAD-LAND1'.

PERFORM GETDATA USING 'X' 'SAPMF02K' '0210'.

perform getdata using ' ' LFB1-AKONT 'IT_UPLOAD-AKONT'.

perform getdata using ' ' LFB1-FDGRV 'IT_UPLOAD-FDGRV'.

PERFORM GETDATA USING 'X' 'SAPMF02K' '0215'.

perform getdata using ' ' LFB1-ZTERM 'IT_UPLOAD-ZTERM'.

PERFORM GETDATA USING 'X' 'SAPMF02K' '0220'.

perform getdata using ' ' LFB5-MAHNA 'IT_UPLOAD-MAHNA'.

PERFORM GETDATA USING 'X' 'SAPMF02K' '0310'.

perform getdata using ' ' LFM1-WAERS 'IT_UPLOAD-WAERS'.

ENDFORM. " POPULATE_DATA

&----


*& Form GETDATA

&----


  • text

----


  • -->P_0213 text

  • -->P_0214 text

  • -->P_0215 text

----


FORM GETDATA USING VALUE(P_0213)

VALUE(P_0214)

VALUE(P_0215).

IF P_0213 = 'X'.

IT_BDCDATA-PROGRAM = P_0213.

IT_BDCDATA-DYNPRO = P_0214.

IT_BDCDATA-DYNBEGIN = P_0215.

ELSE.

IT_BDCDATA-FNAM = P_0214.

IT_BDCDATA-FVAL = P_0215.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
379

When u use GUI_UPLOAD, U can not assign file type as 'dat'. This must be either ASC or BIN.

Make sure ur flat file path should correct..

This well help u...

1 REPLY 1
Read only

Former Member
0 Likes
380

When u use GUI_UPLOAD, U can not assign file type as 'dat'. This must be either ASC or BIN.

Make sure ur flat file path should correct..

This well help u...