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

Converting Parameters to the correct type

Former Member
0 Likes
825

Hi,

I am calling GUI_Upload with a parameter type

parameters File(35) type c. "File

Gui upload expects astring, but parameters does allow me to declare a string - how do I get round this.

Thankss.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
792

Yes, you need to move the parmeter field to a string field because that is what the function module expects.

parameters: p_file(50) type c.
Data: str type string.

str = p_file.

CALL FUNCTION 'GUI_UPLOAD'
     exporting
            file = str.

Regards,

Rich HEilman

Hi,

I am calling GUI_Upload with a parameter type

parameters File(35) type c. "File

Gui upload expects astring, but parameters does allow me to declare a string - how do I get round this.

Thankss.

4 REPLIES 4
Read only

Former Member
0 Likes
792

declare a variable type string inside the your form. Then assign your character type parameter to this string type variable.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
793

Yes, you need to move the parmeter field to a string field because that is what the function module expects.

parameters: p_file(50) type c.
Data: str type string.

str = p_file.

CALL FUNCTION 'GUI_UPLOAD'
     exporting
            file = str.

Regards,

Rich HEilman

Read only

Former Member
0 Likes
792

Sims,

Declare as follows:

<b> parameters File type rlgrap-filename</b>

Thanks

Kam

Note: Allot points for helpful postings

Read only

Former Member
0 Likes
792

Hi,

Try doing like this.

PARAMETERS: P_FILE1 LIKE IBIPPARMS-PATH DEFAULT 'C:\'.

data:

V_FILE1 LIKE RLGRAP-FILENAME.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE1.

  • VALUE REQUEST FUNCTIONALITY FOR INPUT FILE NAME

PERFORM F4_FILENAME USING P_FILE1.

V_FILE1 = P_FILE1.

IN GUI_UPLOAD, send v_file1 as parameter.

Regards,

Sailaja.

Dont forget to reward points, if answer helps you.