Application Development 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: 

want excute the program accourding to the radio buttons

Former Member
0 Kudos

hello,

i am writing an extraction program. here i want to get the out put file in diffrent formats based on the selection on myselection screen.

if

I seclect the radio button "EXCEL" the output should be excel file.

else

if

I select the radio button "DAT" the output should be DAT file.

Thanks,

vineetha.

1 ACCEPTED SOLUTION

former_member188829
Active Contributor
0 Kudos

Hi Vineetha,

Check this program..

PARAMETERS:p_vbeln LIKE vbrp-vbeln.

Parameters:EXCEL radiobutton group GP1.

Parameters:TEXT radiobutton group GP1.

DATA:BEGIN OF it_vbrp OCCURS 0,

vbeln LIKE vbrp-vbeln,

posnr LIKE vbrp-posnr,

meins LIKE vbrp-meins,

ntgew LIKE vbrp-ntgew,

END OF it_vbrp.

START-OF-SELECTION.

SELECT vbeln

posnr

meins

ntgew FROM vbrp INTO TABLE it_vbrp where vbeln eq p_vbeln.

if EXCEL = 'X'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME ='C:\Documents and Settings\Vishnu.Chintala\reddy.xls'

TABLES

DATA_TAB = IT_VBRP

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Endif.

If TEXT = 'X'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME ='C:\Documents and Settings\Vishnu.Chintala\reddy2.TXT'

TABLES

DATA_TAB = IT_VBRP

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.

3 REPLIES 3

Former Member
0 Kudos

Hi ,

make use of this FM's

RH_START_EXCEL_WITH_DATA --->for Excel

RH_START_WWORD_WITH_DATA--->Word

Regards

peram

Former Member
0 Kudos

if excell = 'X'.

<b>perform download using v_excell.</b>

else

<b>perform download using v_dat.</b>

select the radio button "DAT" the output should be DAT file.

endif.

perform download using p_ass.</b>

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = L_XML_SIZE

FILENAME = LD_FULLPATH

FILETYPE = 'BIN'

IMPORTING

FILELENGTH = L_XML_SIZE

TABLES

DATA_TAB =

  • FIELDNAMES =

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endform.

former_member188829
Active Contributor
0 Kudos

Hi Vineetha,

Check this program..

PARAMETERS:p_vbeln LIKE vbrp-vbeln.

Parameters:EXCEL radiobutton group GP1.

Parameters:TEXT radiobutton group GP1.

DATA:BEGIN OF it_vbrp OCCURS 0,

vbeln LIKE vbrp-vbeln,

posnr LIKE vbrp-posnr,

meins LIKE vbrp-meins,

ntgew LIKE vbrp-ntgew,

END OF it_vbrp.

START-OF-SELECTION.

SELECT vbeln

posnr

meins

ntgew FROM vbrp INTO TABLE it_vbrp where vbeln eq p_vbeln.

if EXCEL = 'X'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME ='C:\Documents and Settings\Vishnu.Chintala\reddy.xls'

TABLES

DATA_TAB = IT_VBRP

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Endif.

If TEXT = 'X'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME ='C:\Documents and Settings\Vishnu.Chintala\reddy2.TXT'

TABLES

DATA_TAB = IT_VBRP

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.