Skip to Content
author's profile photo Former Member
Former Member

want excute the program accourding to the radio buttons

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 30, 2007 at 08:53 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 08:49 AM

    Hi ,

    make use of this FM's

    RH_START_EXCEL_WITH_DATA --->for Excel

    RH_START_WWORD_WITH_DATA--->Word

    Regards

    peram

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 08:51 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.