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

calling class

Former Member
0 Likes
715

Hi,

I have created a program which upload file from presentation server .from this program I want to call Class , please guide me how to do this.

thanks

bobby

6 REPLIES 6
Read only

Former Member
0 Likes
681

Hi Booby,

I am ot sure if I understood your question...Well here are the FM for uploading files:

1.'F4_FILENAME'

2. 'GUI_UPLOAD'

EXAMPLE

REPORT ZEX_READFILE_FROMDIR .

Data: d_filename like IBIPPARMS-PATH,

d_file type string.

data : begin of itab occurs 0,

values(1000) type c,

end of itab.

  • The following function module calls the File/Path Selector Dialog Box

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = ' '

IMPORTING

FILE_NAME = d_filename.

d_file = d_filename.

  • The following function module uploads the file into the internal table

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = d_file

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = ' '

HEADER_LENGTH = 0

READ_BY_LINE = 'X'

DAT_MODE = ' '

TABLES

DATA_TAB = itab

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.

  • Output the internal Table

loop at itab.

Write:/ ITAB.

endloop.

Read only

0 Likes
681

I need to call proxy class , in that I have to pass uploaded data, so I need help on how to do that

thanks

Read only

Former Member
0 Likes
681

Hi Bobby,

If you need to call a method in a class, what you need to do is :

Create an object of that class. And using that object, call its methods.

Check the perform call_alv_grid from below link:

http://wiki.sdn.sap.com/wiki/display/HOME/objectorientedProgramminginALV

It is calling method "set_table_for_first_display" of class "cl_gui_alv_grid".

If your question is still unanswered, please explain your requirement little more clearly....

Regards,

Nisha Vengal.

Read only

Former Member
0 Likes
681

Hi Bobby,

Use class CL_GUI_FRONTEND_SERVICES

Regards,

Kumar M

Read only

0 Likes
681

Hi Bobby,

Is your requirement to send uploaded data, through an outbound Proxy interface ?

If so, below link will help you.

http://wiki.sdn.sap.com/wiki/display/XI/ABAPClientProxytoABAPServerProxy+Scenario

Regards,

Nisha Vengal.

Read only

0 Likes
681

Hi Nisha ,

my requirement is to send upload data through inbound proxy , could you please give me the details for the same

thanks

bobby