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

Gui_Upload dump ---CALL_FUNCTION_CONFLICT_TYPE

Former Member
0 Likes
1,616

Hi,

I have a bdc info record and I am using gui_upload if EINE-NETPR = 0, then I am getting this dump.

Runtime Errors CALL_FUNCTION_CONFLICT_TYPE

Exception CX_SY_DYN_CALL_ILLEGAL_TYPE

Type conflict when calling a function module.

I debugged it and it is dumping on

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = p_fname

I am sending my code, please help me resolve this issue.

Thank you.

Neelu.

REPORT zmm_3030_info_record_load NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE bdcrecx1.

DATA: v_norbm(17), v_netpr(14), v1_netpr(14).

DATA: V_APLFZ(3) TYPE C.

----


  • TABLES:

----


TABLES: mara, eina, eine.

----


  • INTERNAL TABLES *

----


DATA: BEGIN OF it_eina_eine OCCURS 0,

infnr LIKE eina-infnr,

lifnr LIKE eina-lifnr,

matnr LIKE eina-matnr,

ekorg LIKE eine-ekorg,

werks LIKE eine-werks,

meins LIKE eina-meins,

waers LIKE eine-waers,

aplfz LIKE eine-aplfz,

norbm LIKE eine-norbm,

netpr LIKE eine-netpr.

DATA: END OF it_eina_eine.

DATA: BEGIN OF it_record OCCURS 0,

  • infnr LIKE eina-infnr,

lifnr LIKE eina-lifnr,

matnr LIKE eina-matnr,

netpr LIKE eine-netpr.

DATA: END OF it_record.

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

SELECT-OPTIONS: s_matnr FOR eina-matnr,

s_lifnr FOR eina-lifnr.

PARAMETERS: p_werks LIKE eine-werks DEFAULT '3030',

p_ekorg LIKE eine-ekorg DEFAULT '9000'.

PARAMETERS: p_fname LIKE RLGRAP-FILENAME. "lower case.

*PARAMETERS: DATASET TYPE STRING.

SELECTION-SCREEN END OF BLOCK b1.

*at selecion-screen on value request for file name

at selection-screen on value-request for p_fname.

perform get_file_name.

START-OF-SELECTION.

PERFORM get_inforec_data.

if p_fname is not initial.

PERFORM sub_upload_file.

endif.

LOOP AT it_eina_eine.

CLEAR: v_norbm, v_netpr, v_aplfz.

WRITE it_eina_eine-norbm TO v_norbm UNIT it_eina_eine-meins

NO-GROUPING LEFT-JUSTIFIED.

WRITE it_eina_eine-netpr TO v_netpr CURRENCY it_eina_eine-waers

NO-GROUPING LEFT-JUSTIFIED.

WRITE it_eina_eine-aplfz To v_aplfz.

PERFORM bdc_dynpro USING 'SAPMM06I' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR' 'EINA-LIFNR'.

PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

PERFORM bdc_field USING 'EINA-LIFNR' it_eina_eine-lifnr.

PERFORM bdc_field USING 'EINA-MATNR' it_eina_eine-matnr.

PERFORM bdc_field USING 'EINE-EKORG' p_ekorg.

PERFORM bdc_field USING 'EINE-WERKS' p_werks.

PERFORM bdc_field USING 'RM06I-NORMB' 'X'.

PERFORM bdc_dynpro USING 'SAPMM06I' '0101'.

PERFORM bdc_field USING 'BDC_CURSOR' 'EINA-MAHN1'.

PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

PERFORM bdc_dynpro USING 'SAPMM06I' '0102'.

PERFORM bdc_field USING 'BDC_CURSOR' 'EINE-NORBM'.

PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.

PERFORM bdc_field USING 'EINE-APLFZ' v_aplfz.

PERFORM bdc_field USING 'EINE-NORBM' v_norbm.

IF it_eina_eine-netpr > 0.

PERFORM bdc_field USING 'EINE-NETPR' v_netpr.

ELSE.

Read table it_record with key matnr = it_record-matnr

lifnr = it_record-lifnr.

if sy-subrc = 0.

WRITE it_record-netpr TO v1_netpr CURRENCY it_eina_eine-waers

NO-GROUPING LEFT-JUSTIFIED.

PERFORM bdc_field USING 'EINE-NETPR' v1_netpr.

endif.

ENDIF.

PERFORM bdc_transaction USING 'ME11'.

ENDLOOP.

&----


*& Form get_inforec_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_inforec_data .

SELECT eina~infnr

eina~lifnr

eina~matnr

eina~meins

eine~ekorg

eine~werks

eine~waers

eine~aplfz

eine~norbm

eine~netpr

INTO CORRESPONDING FIELDS OF TABLE it_eina_eine

FROM eina JOIN eine ON einainfnr = eineinfnr

WHERE matnr IN s_matnr

AND lifnr IN s_lifnr.

ENDFORM. " get_purchlist_data

&----


*& Form get_file_name

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_file_name .

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = p_fname.

ENDFORM. " get_file_name

**&----


**

**& Form sub_upload_file

**&----


**

    • text

**----


**

    • --> p1 text

    • <-- p2 text

**----


**

FORM sub_upload_file .

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = p_fname

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = it_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.

CASE sy-subrc.

WHEN 0.

WRITE / 'File upload is ok'.

WHEN 1.

WRITE: / 'File path is invalid'.

EXIT.

WHEN 2.

WRITE: / 'Error occured while reading the Input file'.

EXIT.

WHEN 13.

WRITE: / 'Access denied for the Input file'.

EXIT.

WHEN OTHERS.

WRITE: / 'Problem with the Input file'.

EXIT.

ENDCASE.

ENDIF.

ENDFORM. " sub_upload_file

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,183

Hi Ram,

I changed it to PARAMETERS: p_fname LIKE STRING.

then it is giving me error.

Field "STRING" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.

Please help me.

Thank you.

Neelu.

6 REPLIES 6
Read only

Former Member
0 Likes
1,183

Use filename of type string.

Change

PARAMETERS: p_fname LIKE RLGRAP-FILENAME. "lower case.

To

PARAMETERS: p_fname LIKE STRING.

Cheers,

Ram

Read only

Former Member
0 Likes
1,184

Hi Ram,

I changed it to PARAMETERS: p_fname LIKE STRING.

then it is giving me error.

Field "STRING" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.

Please help me.

Thank you.

Neelu.

Read only

0 Likes
1,183

Ok , sorry.

revert it to

PARAMETERS: p_fname LIKE RLGRAP-FILENAME.

declare another variable

DATA: lv_filename type string.

Before calling Function Module GUI_UPLOAD assign p_fname to lv_filename using stmt below.

lv_filename = p_fname.

Read only

Former Member
0 Likes
1,183

Hi RAm,

DATA: lv_filename type string.

It is saying 'The deep data type "STRING" is not allowed'.

Please help me.

Thanks

Neelu.

Read only

0 Likes
1,183

Here is the program.


REPORT zmm_3030_info_record_load NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE bdcrecx1.

DATA: v_norbm(17), v_netpr(14), v1_netpr(14).
DATA: v_aplfz(3) TYPE c.

*----------------------------------------------------------------------*
* TABLES:
*----------------------------------------------------------------------*

TABLES: mara, eina, eine.

*----------------------------------------------------------------------*
* INTERNAL TABLES *
*----------------------------------------------------------------------*

DATA: BEGIN OF it_eina_eine OCCURS 0,
infnr LIKE eina-infnr,
lifnr LIKE eina-lifnr,
matnr LIKE eina-matnr,
ekorg LIKE eine-ekorg,
werks LIKE eine-werks,
meins LIKE eina-meins,
waers LIKE eine-waers,
aplfz LIKE eine-aplfz,
norbm LIKE eine-norbm,
netpr LIKE eine-netpr.
DATA: END OF it_eina_eine.

DATA: BEGIN OF it_record OCCURS 0,
* infnr LIKE eina-infnr,
lifnr LIKE eina-lifnr,
matnr LIKE eina-matnr,
netpr LIKE eine-netpr.
DATA: END OF it_record.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR eina-matnr,
s_lifnr FOR eina-lifnr.

PARAMETERS: p_werks LIKE eine-werks DEFAULT '3030',
p_ekorg LIKE eine-ekorg DEFAULT '9000'.

PARAMETERS: p_fname LIKE rlgrap-filename. "lower case.

*PARAMETERS: DATASET TYPE STRING.

SELECTION-SCREEN END OF BLOCK b1.

*at selecion-screen on value request for file name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
  PERFORM get_file_name.


START-OF-SELECTION.

  PERFORM get_inforec_data.

  IF NOT p_fname IS INITIAL.
    PERFORM sub_upload_file.
  ENDIF.

  LOOP AT it_eina_eine.

    CLEAR: v_norbm, v_netpr, v_aplfz.

    WRITE it_eina_eine-norbm TO v_norbm UNIT it_eina_eine-meins
    NO-GROUPING LEFT-JUSTIFIED.
    WRITE it_eina_eine-netpr TO v_netpr CURRENCY it_eina_eine-waers
    NO-GROUPING LEFT-JUSTIFIED.
    WRITE it_eina_eine-aplfz TO v_aplfz.

    PERFORM bdc_dynpro USING 'SAPMM06I' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'EINA-LIFNR'.
    PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
    PERFORM bdc_field USING 'EINA-LIFNR' it_eina_eine-lifnr.
    PERFORM bdc_field USING 'EINA-MATNR' it_eina_eine-matnr.
    PERFORM bdc_field USING 'EINE-EKORG' p_ekorg.
    PERFORM bdc_field USING 'EINE-WERKS' p_werks.

    PERFORM bdc_field USING 'RM06I-NORMB' 'X'.

    PERFORM bdc_dynpro USING 'SAPMM06I' '0101'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'EINA-MAHN1'.
    PERFORM bdc_field USING 'BDC_OKCODE' '/00'.

    PERFORM bdc_dynpro USING 'SAPMM06I' '0102'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'EINE-NORBM'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
    PERFORM bdc_field USING 'EINE-APLFZ' v_aplfz.
    PERFORM bdc_field USING 'EINE-NORBM' v_norbm.

    IF it_eina_eine-netpr > 0.
      PERFORM bdc_field USING 'EINE-NETPR' v_netpr.
    ELSE.
      READ TABLE it_record WITH KEY matnr = it_record-matnr
      lifnr = it_record-lifnr.
      IF sy-subrc = 0.
        WRITE it_record-netpr TO v1_netpr CURRENCY it_eina_eine-waers
        NO-GROUPING LEFT-JUSTIFIED.
        PERFORM bdc_field USING 'EINE-NETPR' v1_netpr.
      ENDIF.
    ENDIF.

    PERFORM bdc_transaction USING 'ME11'.

  ENDLOOP.


*&---------------------------------------------------------------------*
*& Form get_inforec_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*

FORM get_inforec_data .

  SELECT eina~infnr
  eina~lifnr
  eina~matnr
  eina~meins
  eine~ekorg
  eine~werks
  eine~waers
  eine~aplfz
  eine~norbm
  eine~netpr
  INTO CORRESPONDING FIELDS OF TABLE it_eina_eine
  FROM eina JOIN eine ON eina~infnr = eine~infnr
  WHERE matnr IN s_matnr
  AND lifnr IN s_lifnr.

ENDFORM. " get_purchlist_data

*&---------------------------------------------------------------------*
*& Form get_file_name
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_file_name .
  CALL FUNCTION 'F4_FILENAME'
       IMPORTING
            file_name = p_fname.
ENDFORM. " get_file_name


**&---------------------------------------------------------------------
**
**& Form sub_upload_file
**&---------------------------------------------------------------------
**
** text
**----------------------------------------------------------------------
**
** --> p1 text
** <-- p2 text
**----------------------------------------------------------------------
**
FORM sub_upload_file .

  <b>DATA: l_filename TYPE string.</b>

  l_filename = p_fname.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename = l_filename
      filetype = 'ASC'
*     HAS_FIELD_SEPARATOR = ' '
*     HEADER_LENGTH = 0
*     READ_BY_LINE = 'X'
*     DAT_MODE = ' '
*     CODEPAGE = ' '
*     IGNORE_CERR = ABAP_TRUE
*     REPLACEMENT = '#'
*     CHECK_BOM = ' '
*   IMPORTING
*     FILELENGTH =
*     HEADER =
    TABLES
      data_tab = it_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.
    CASE sy-subrc.
      WHEN 0.
        WRITE / 'File upload is ok'.
      WHEN 1.
        WRITE: / 'File path is invalid'.
        EXIT.
      WHEN 2.
        WRITE: / 'Error occured while reading the Input file'.
        EXIT.
      WHEN 13.
        WRITE: / 'Access denied for the Input file'.
        EXIT.
      WHEN OTHERS.
        WRITE: / 'Problem with the Input file'.
        EXIT.
    ENDCASE.
  ENDIF.

ENDFORM. " sub_upload_file

Read only

Former Member
0 Likes
1,183

Hi Ram And Srinivas,

Thank you. Now my program is working fine.

Regards

Neelu.