How to find function codes of the buttons in ABAP Webdynpro

I had 2 buttons in my input screen of the WebDynpro, for both buttons some piece of logic is common. So i wrote that common logic in the default method 'WDDOBEFOREACTION', which will be triggered always before the corresponding methods got triggered.
Now my problem is the method 'WDDOBEFOREACTION' triggering even when user hits ENTER in the input screen, to prevent the common logic not to execute need to write some condition based on the user action. But unfortunately was not able to find the way. Could any one suggest me on this.

For your specific requirement :
you should first determine the current action which triggered this WDDOBEFOREACTION method,
as this method triggers for every action performed on the webdynpro view.
For that below is the code
  DATA lo_api_view_controller    TYPE REF TO if_wd_view_controller.
  DATA lo_action                 TYPE REF TO if_wd_action.
  lo_api_view_controller = wd_this->wd_get_api( ).
  lo_action = lo_api_view_controller->get_current_action( ).
  IF lo_action IS NOT BOUND.
          IF lo_action->name EQ 'BUTTON1'   OR   lo_action->name EQ 'BUTTON2'.
Where BUTTON1 and BUTTON2 are the actions associated with both the buttons.
Write your common logic here and now it would get executed only for both these button cliks only
           ENDIF.
ENDIF.
Edited by: Avasarala Sampath on Oct 28, 2011 7:26 AM
Edited by: Avasarala Sampath on Oct 28, 2011 7:29 AM

Similar Messages

  • How to find function code for buttons on toolbar in oops alv

    Hi experts,
    I want to remove some buttons from toolbar in oops alv, i know the procedure like get function code and pass the value in a table and pass that table to IT_TOOLBAR_EXCLUDING of
    method set_table_for_first_display but I WANT TO KNOW HOW TO FIND FUNCTION CODE FOR BUTTONS ON TOOLBAR IN OOPS ALV

    Hi Prakash,
    -->First you have to set the pf status in your alv program by,
    {FORM pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'FIRST'.
    ENDFORM.                    "PF_STATUS}
    -->Pass this Subroutine name in the Function module, Reuse_alv_grid_display's parameters i.e,
          i_callback_pf_status_set          = 'PF_STATUS'}
    *-->Then doble click on that pf status,
    From the menu bar, select Extras->Adjust Template->List Viewer,
    This will give you the existing statndard gui status of the program*
    ->Then catch that function codes in the User command Parameter of the Function module Reuse.. i.e,
          i_callback_user_command           = 'COMM'
    And make a subroutine of the name 'COMM'i.e,
    FORM comm USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
      DATA: okcode TYPE sy-ucomm.
      okcode = ucomm.
      CASE okcode.
        WHEN 'REF'.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel         = 'MANSI'
            txt1          = 'CREATED BY'
            txt2          = SY-UNAME
          TXT3          = ' '
          TXT4          = ' '
    endcase.
    Hope it helps you
    Regrds
    Mansi

  • How to get function code of enter button in bdc manually

    hi
    i need to know how to get function code of enter button in bdc manually like in screen i want to capture techincal infor of enter buttion and itd fucntion cod ehow can i get it i mean what is the key in keyboard to display that
    i want to capture enter button and for eg status button etc funtion code
    pls suggest
    arora

    Hi,
    Want you need to do is go to transaction SHDB and record the bdc for the transaction you want, during transaction press the buttons for which you want the bdc code. And after this go press the back button and check the list of all the things recorded in Recorder.
    And for SHDB help check this link:
    http://abaplovers.blogspot.com/2008/02/recording-bdc-using-transaction-shdb.html
    Hope this helps.
    Regards,
    Qamar.

  • How to find Function codes

    Dear SAP friends,
    Does anybody knows an easy way to find function codes ( those of type ui_func) of standard ALV grid toolbar?
    Searching this forum I learned that you can do se11 and read table RSMPTEXTS for program SAPLSVLV_FULLSCREEN or just se41 for program SAPLSVLV_FULLSCREEN.
    Shouldn't there be some kind of complete Reference about function codes of standard ALV grid?
    Please share if you know.
    Thank you
    Tatyana

    Thank you, Ferry.
    Reading method BUILD_COMPLETE_TOOLBAR of class CL_GUI_ALV_GRID you
    can see an icon code, function code and text  for the buttons of standard ALV grid toolbar.
    Regards,
    Tatyana

  • How to set Function Code for Radion Buttons in Screen painter

    Hi,
    I have faced problem of grouping 3 radio buttons in screen painter (no graphical editor). How to do it?
    I have checked similiar threads in SDN, but those are for graphical editor.
    Radio Buttons in custom screeen
    http://****************/Tutorials/ABAP/Checkbox/page1.htm
    http://****************/Tutorials/ABAP/Checkbox/page2.htm
    Regards,
    Sukhbold

    Hi,
    U want to create radio button in the selection screen  then u can create like this
    PARAMETERS : c1 AS CHECKBOX USER-COMMAND cd,
    r1 RADIOBUTTON GROUP rad,
    r2 RADIOBUTTON GROUP rad.
    AT SELECTION-SCREEN OUTPUT.
    IF c1 = 'X'.
    LOOP AT SCREEN.
    IF screen-name = 'R1'.
    screen-input = '0'.
    screen-active = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ELSE.
    LOOP AT SCREEN.
    IF screen-name = 'R1'.
    screen-input = '1'.
    screen-active = '1'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    Thanks,

  • How to find function code for Dynamic generated program

    Hi,
    I have created a dynamic program for getting different selection screens depending on inputs . I am finding a flaw that, pressing 'BACK' buttn is leading some other action which was coded by me,  instead of going back.
    SY-UCOMM is also not working as it is dynamic program.
    Help me for getting previous screen.
    Please suggest me the inputs.Thank u
    Regards
    Aditya

    Hi Klaus,
    As per ur instructions, I replaced SY-UCOMM with SSCRFIELDS.
    But no change in my problem.
    The following screen shot is a program which is coded dynamically using fieldsymbols.
    When I press BACK here for the following code selectionscreen, I am getting someother action which was coded by me. But not going back.
    Twist is, SSCRFIELDS-UCOMM or SY-UCOMM is getting captured for 'F8', but not 'BACK'.
    I hope, I have explained my issue clearly. Please let me know, if any deep clarifications needed.
    Regards,
    Aditya

  • How to find out what are the functions supported by string class

    Hi,
    Can any one let me know how to find what are all the functions supported by the string class in standard(STL) library on solaris.
    Regards,
    Vignesh

    1. Any C++ textbook that covers the Standard Library will tell you about the standard string class. A good tutorial and reference for the entire Standard Library is "The C++ Standard Library" by Nicolai Josuttis, published by Addison Wesley.
    2. WIth Sun C++, the command
    man -s3C++ basic_string
    provides documentation for the default libCstd version of the Standard Library.
    3. You could look at the <string> header itself. I don't recommend that approach.

  • How to find Transaction code from Report/program name ?

    Dear all,
    How to find Transaction code if i know Report/program name ?

    Hi,
    In se 38 when u open ur program,in the application toolbar u have a button beside the where-used list button as display object list.on clicking this button,a window will be opened at the left most corner for repository browser,in this u can find any tranasctions,fileds,screens,dictionary structures defined for the program.
    if any transaction is created for the program u can find it under the transaction folder.
    revert back for further queries.
    Regards,
    Sravanthi

  • Assigning a function code to radio button in 4.5B

    I’ve a requirement wherein I need to trigger the PAI event in a module pool program when I select a particular radiobutton in a group and do some processing subsequently.
    For this I need to assign a function code to the radiobutton group.
    But the function code field is disabled for input in the properties screen of the layout. Our client system is SAP 4.5B.
    I am able to assign function codes to radio button groups in esuides(4.6C) and other systems.
    I want to know whether we can assign a function code at all to a radio button group in version 4.5B.
    If so, please tell me how to do this.
    With regards,
    ramu.

    Hi,
    we can't assign function codes to radio buttons.
    for assigning some code to radio button.check the radio button status.
    in PAI.
    if RAD1 = 'X'.
    xxxxxxxxxxx.
    xxxxxxxxx.
    elseif RAD2 = 'X'.
    xxxxxxxxx.
    xxxxxxxxxxxx.
    endif.
    regards,
    bharat.

  • How to find out OrgUnit from the MSS team viewer iview

    Hi Experts,
    Please refer following link:
    https://wiki.sdn.sap.com/wiki/display/profile/HowtoreadinformationfromtheteamviewerinWeb+Dynpro
    Using this link, I am able to find out the perno.
    I have to find out OrgUnit of selected person. I did the mapping. I have also written following code:
    String orgunit = wdContext.currentSelectedOrgUnitElement().getObjid();
    wdComponentAPI.getMessageManager().reportSuccess("You have selected orgunit "+ orgunit);
    However, orgunit value is always null
    Can you please let me know how we can get the orgunit in this case?
    Regards,
    Gary

    Hi Gabriel,
    Requirement 1
    Thanks. I did so. Using this I can see the OrgUnit. However, this is the OrgUnit of MSS user. It remains same through out the program. It is unlike pernr which changes as the user clicks on different Employees.
    My exact requirement is as below:
    User will click on Employee Selection drop down box. After that he will select "Employees from Organizational Structure". Here organization structure will be displayed. Now the user will expand Org Structure. I want to know the Org Unit of different Organization as the user will go on expanding the Org Structure using the buttons
    Requirement 2
    User will click on Employee Selection drop down box. After that he will select "Employees from Organizational Unit". Now we can see the Go button. I have to write some code on the button. Where I can find the code for the button. I spent lot of time. I am not able to find out the exact place where the view for the button is located.
    Please help.
    Regards,
    Gary

  • Function code for execute button

    Hi,
    I have a requirement like this...
    there is a program for selective deletion from a data target by a transaction called delete_facts.
    this generates a program for selective deletion. when i run this report there comes one screen asks for selections fields and then again excute it then deletion will happen.
    But this program i need to modify for certain default values so as to avoid entering of the values in the selection screen.
    i will use default value this will solve my 1st purpose but since this program has to be scheduled from process chain, the 2nd execute funtionality( once the values appear in the screen) shud be automated.
    can anybody tell me how to do this that is after program runs values will be passed to selection screen and selection screen shud not be shown and execute shud happen automatically.
    this is the code generated by transaction delete_facts:
    *& Report  ZTEST_DELETE1
    REPORT  ZTEST_DELETE1.
    generated Header from i_sel_repid
    generated REPORT (RSDRD)
    (should be deleted after use)
    Generated by..: SALAGUN
    Date/Time.....: 20070322 / 051426
    *REPORT GP457FUV92GJS4663HYHXLYC9Q7 .
    generated Tables from i_t_tables
                     and  i_datatarget
    TABLES:
    SSCRFIELDS,
    /BIC/SZTESTBC
    ,/BI0/SCHNGID
    ,/BI0/SRECORDTP
    ,/BI0/SREQUID
    ,/BI0/SDATE
    ,/BI0/SUNIT
    generated DATA/TYPES
    TYPE-POOLS: RSDRD, RSDQ.
    DATA:
      L_INTERACTIVE      TYPE RS_BOOL,
      L_ANSWER(1)        TYPE C,
      L_TYPE(1)          TYPE C,
      L_PARALLEL         TYPE I,
      L_NO_OF_ROWS       TYPE I,
      L_NO_OF_ROWS_C(10) TYPE C,
      L_TITEL            TYPE RS_CHAR72,
      L_TEXT1            TYPE RS_CHAR72,
      L_TEXT2            TYPE RS_CHAR72,
      L_S_RANGE          TYPE RSDRD_S_RANGE,
      L_S_SELTXT         TYPE RSDQ_S_SELTEXT,
      L_SX_SEL           TYPE RSDRD_SX_SEL,
      L_T_MSG            TYPE RS_T_MSG,
      L_THX_SEL          TYPE RSDRD_THX_SEL,
      L_T_SELTXTS        TYPE RSDQ_T_SELTEXT
                              WITH HEADER LINE.
    generated SELECTION-SCREEN from i_t_selscr
    SELECTION-SCREEN BEGIN OF BLOCK B001 WITH FRAME TITLE T001 .
    SELECT-OPTIONS C001 FOR /BIC/SZTESTBC-/BIC/ZTESTBC
    default 'D' TO  'C'.
    SELECTION-SCREEN   END OF BLOCK B001 .
    SELECTION-SCREEN BEGIN OF BLOCK B002 WITH FRAME TITLE T002 .
    SELECT-OPTIONS C002 FOR /BI0/SCHNGID-SID .
    SELECT-OPTIONS C003 FOR /BI0/SRECORDTP-SID .
    SELECT-OPTIONS C004 FOR /BI0/SREQUID-SID .
    SELECTION-SCREEN   END OF BLOCK B002 .
    SELECTION-SCREEN BEGIN OF BLOCK B003 WITH FRAME TITLE T003 .
    SELECT-OPTIONS C005 FOR /BI0/SDATE-DATE0 .
    SELECTION-SCREEN   END OF BLOCK B003 .
    SELECTION-SCREEN BEGIN OF BLOCK B004 WITH FRAME TITLE T004 .
    SELECT-OPTIONS C006 FOR /BI0/SUNIT-UNIT .
    SELECTION-SCREEN   END OF BLOCK B004 .
    SELECTION-SCREEN BEGIN OF BLOCK B005 WITH FRAME TITLE T005 .
    PARAMETERS L_PA TYPE DBMAN_PARALLEL_DEGREE DEFAULT '01'.
    DATA L_P1(1) TYPE C.
    PARAMETERS L_NL TYPE DBMAN_NO_LOGGING AS CHECKBOX DEFAULT ' '.
    PARAMETERS L_SR TYPE DBMAN_SHOW_REPORT AS CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN   END OF BLOCK B005 .
    generated body from i_t_body
    generated INITIALIZATION from i_t_init
                             and  i_t_seltexts
                             and  i_batch_allowed
                             and  i_datatarget
    INITIALIZATION.
    T001 = 'product'.
    T002 = 'Data Package'.
    T003 = 'Time'.
    T004 = 'Unit'.
    T005 = 'Options'.
    SELECTION-SCREEN FUNCTION KEY 1.
    MOVE 'Execute in Bckgrnd' TO SSCRFIELDS-FUNCTXT_01.
    PERFORM RESTRICT_SEL_OPTIONS(SAPLRSDRD).
    SET TITLEBAR 'SELECTION' OF PROGRAM 'SAPLRSDRD' WITH
    ' Delete selected entries from the data target DELETE '.
    L_S_SELTXT-NAME = 'C001'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Base Code'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'C002'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Change Run ID (SID)'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'C003'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Record type (SID)'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'C004'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Request ID (SID)'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'C005'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Calendar Day'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'C006'.
    L_S_SELTXT-KIND = 'S'.
    L_S_SELTXT-TEXT = 'Unit of measure'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'L_PA'.
    L_S_SELTXT-KIND = 'P'.
    L_S_SELTXT-TEXT = 'Parall. deg. during reconstruc'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'L_NL'.
    L_S_SELTXT-KIND = 'P'.
    L_S_SELTXT-TEXT = 'Switch off logging drng recons'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    L_S_SELTXT-NAME = 'L_SR'.
    L_S_SELTXT-KIND = 'P'.
    L_S_SELTXT-TEXT = 'Display generated report'.
    APPEND L_S_SELTXT TO L_T_SELTXTS.
    generated AT SELECTION-SCREEN OUTPUT from i_sel_repid
    AT SELECTION-SCREEN OUTPUT.
    CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
         EXPORTING
              PROGRAM                     =  'GP457FUV92GJS4663HYHXLYC9Q7'
         TABLES
              SELTEXTS                    =  L_T_SELTXTS
         EXCEPTIONS
              PROGRAM_NOT_FOUND           = 1
              PROGRAM_CANNOT_BE_GENERATED = 2
              OTHERS                      = 3.
    generated AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    CASE SSCRFIELDS-UCOMM.
      WHEN 'ONLI'.
        L_INTERACTIVE = RS_C_TRUE.
      WHEN 'OPTI'.
      WHEN 'DELS'.
      WHEN 'FC01'.
        L_INTERACTIVE = RS_C_FALSE.
        SSCRFIELDS-UCOMM = 'ONLI'.
      WHEN 'OTHERS'.
    ENDCASE.
    generated END-OF-SELECTION from i_t_selopt
                               and  i_del_repid
                               and  i_datatarget
                               and  i_gen_mode
    END-OF-SELECTION.
    IF NOT C001[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = 'ZTESTBC'.
      LOOP AT C001 .
        CLEAR L_S_RANGE.
        MOVE C001-SIGN TO L_S_RANGE-SIGN.
        MOVE C001-OPTION TO L_S_RANGE-OPTION.
        MOVE C001-LOW TO L_S_RANGE-LOW.
        MOVE C001-HIGH TO L_S_RANGE-HIGH.
        MOVE RS_C_TRUE TO L_S_RANGE-KEYFL.
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
    IF NOT C002[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = '0CHNGID'.
      LOOP AT C002 .
        CLEAR L_S_RANGE.
        MOVE C002-SIGN TO L_S_RANGE-SIGN.
        MOVE C002-OPTION TO L_S_RANGE-OPTION.
        MOVE C002-LOW TO L_S_RANGE-SIDLOW.
        MOVE C002-HIGH TO L_S_RANGE-SIDHIGH.
        MOVE RS_C_FALSE TO L_S_RANGE-KEYFL.
    start change
        DESCRIBE FIELD C002-LOW TYPE l_type.
        IF l_type = 'I'.
          CONDENSE L_S_RANGE-LOW.
          CONDENSE L_S_RANGE-HIGH.
        ENDIF.
    stop change
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
    IF NOT C003[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = '0RECORDTP'.
      LOOP AT C003 .
        CLEAR L_S_RANGE.
        MOVE C003-SIGN TO L_S_RANGE-SIGN.
        MOVE C003-OPTION TO L_S_RANGE-OPTION.
        MOVE C003-LOW TO L_S_RANGE-SIDLOW.
        MOVE C003-HIGH TO L_S_RANGE-SIDHIGH.
        MOVE RS_C_FALSE TO L_S_RANGE-KEYFL.
    start change
        DESCRIBE FIELD C003-LOW TYPE l_type.
        IF l_type = 'I'.
          CONDENSE L_S_RANGE-LOW.
          CONDENSE L_S_RANGE-HIGH.
        ENDIF.
    stop change
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
    IF NOT C004[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = '0REQUID'.
      LOOP AT C004 .
        CLEAR L_S_RANGE.
        MOVE C004-SIGN TO L_S_RANGE-SIGN.
        MOVE C004-OPTION TO L_S_RANGE-OPTION.
        MOVE C004-LOW TO L_S_RANGE-SIDLOW.
        MOVE C004-HIGH TO L_S_RANGE-SIDHIGH.
        MOVE RS_C_FALSE TO L_S_RANGE-KEYFL.
    start change
        DESCRIBE FIELD C004-LOW TYPE l_type.
        IF l_type = 'I'.
          CONDENSE L_S_RANGE-LOW.
          CONDENSE L_S_RANGE-HIGH.
        ENDIF.
    stop change
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
    IF NOT C005[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = '0CALDAY'.
      LOOP AT C005 .
        CLEAR L_S_RANGE.
        MOVE C005-SIGN TO L_S_RANGE-SIGN.
        MOVE C005-OPTION TO L_S_RANGE-OPTION.
        MOVE C005-LOW TO L_S_RANGE-LOW.
        MOVE C005-HIGH TO L_S_RANGE-HIGH.
        MOVE RS_C_TRUE TO L_S_RANGE-KEYFL.
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
    IF NOT C006[] IS INITIAL.
      CLEAR L_SX_SEL.
      L_SX_SEL-IOBJNM = '0UNIT'.
      LOOP AT C006 .
        CLEAR L_S_RANGE.
        MOVE C006-SIGN TO L_S_RANGE-SIGN.
        MOVE C006-OPTION TO L_S_RANGE-OPTION.
        MOVE C006-LOW TO L_S_RANGE-LOW.
        MOVE C006-HIGH TO L_S_RANGE-HIGH.
        MOVE RS_C_TRUE TO L_S_RANGE-KEYFL.
        APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
      ENDLOOP.
      INSERT L_SX_SEL INTO TABLE L_THX_SEL.
    ENDIF.
      L_PARALLEL = L_PA.
      IF L_INTERACTIVE EQ RS_C_TRUE.
      CALL FUNCTION 'RSDRD_SEL_DELETION'
           EXPORTING
                I_DATATARGET   = 'DELETE'
                I_THX_SEL           = L_THX_SEL
                I_AUTHORITY_CHECK   = RS_C_TRUE
                I_NO_LOGGING        = L_NL
                I_PARALLEL_DEGREE   = L_PARALLEL
                I_SHOW_REPORT       = L_SR
           CHANGING
                C_T_MSG             = L_T_MSG.
      ELSE.
        CALL FUNCTION 'RSDRD_BUILD_REPORT_FOR_BATCH'
             EXPORTING
              I_REPID        = 'GP457FWJUK1J1F3ZIZZOEH9U533'
              I_DATATARGET   = 'DELETE'
              I_GEN_ONLY          = RS_C_FALSE
              I_THX_SEL           = L_THX_SEL
              I_AUTHORITY_CHECK   = RS_C_TRUE
              I_NO_LOGGING        = L_NL
              I_PARALLEL_DEGREE   = L_PARALLEL
              I_SHOW_REPORT       = L_SR
         CHANGING
              C_T_MSG             = L_T_MSG.
      ENDIF.
    Thanks in advance,
    Vijaya

    hi!
    Function code for execute button is 'ONLI'.
    try ur code using it!!
    Reward points if it helps.
    Regards,
    Neha Bansal.
    Message was edited by:
            Neha Bansal

  • How to find bar codes and mails to send clients in smartforms

    HI friends,
        How to find bar codes in smartforms and also how to send mail to the client. I have developed one object in smartforms, but i don't know how to send maill to the client. Pls help me........................
    Thanks in Advance.
    Saradhi.

    Hi!
    Here is the code to send the Smartform to mail as PDF attachment.
    *& Report ZTEST_PDF_MAIL
    REPORT ZTEST_PDF_MAIL.
    Internal Table declarations
    DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
    I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
    I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
    I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    WA_OBJHEAD TYPE SOLI_TAB,
    W_CTRLOP TYPE SSFCTRLOP,
    W_COMPOP TYPE SSFCOMPOP,
    W_RETURN TYPE SSFCRESCL,
    WA_DOC_CHNG TYPE SODOCCHGI1,
    W_DATA TYPE SODOCCHGI1,
    WA_BUFFER TYPE STRING, "To convert from 132 to 255
    Variables declarations
    V_FORM_NAME TYPE RS38L_FNAM,
    V_LEN_IN LIKE SOOD-OBJLEN,
    V_LEN_OUT LIKE SOOD-OBJLEN,
    V_LEN_OUTN TYPE I,
    V_LINES_TXT TYPE I,
    V_LINES_BIN TYPE I.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    FORMNAME = 'ZTEST'
    IMPORTING
    FM_NAME = V_FORM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    W_CTRLOP-GETOTF = 'X'.
    W_CTRLOP-NO_DIALOG = 'X'.
    W_COMPOP-TDNOPREV = 'X'.
    CALL FUNCTION V_FORM_NAME
    EXPORTING
    CONTROL_PARAMETERS = W_CTRLOP
    OUTPUT_OPTIONS = W_COMPOP
    USER_SETTINGS = 'X'
    IMPORTING
    JOB_OUTPUT_INFO = W_RETURN
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I_OTF[] = W_RETURN-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    IMPORTING
    BIN_FILESIZE = V_LEN_IN
    TABLES
    OTF = I_OTF
    LINES = I_TLINE
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
    LOOP AT I_TLINE.
    TRANSLATE I_TLINE USING '~'.
    CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
    ENDLOOP.
    TRANSLATE WA_BUFFER USING '~'.
    DO.
    I_RECORD = WA_BUFFER.
    APPEND I_RECORD.
    SHIFT WA_BUFFER LEFT BY 255 PLACES.
    IF WA_BUFFER IS INITIAL.
    EXIT.
    ENDIF.
    ENDDO.
    Attachment
    REFRESH: I_RECLIST,
    I_OBJTXT,
    I_OBJBIN,
    I_OBJPACK.
    CLEAR WA_OBJHEAD.
    I_OBJBIN[] = I_RECORD[].
    Create Message Body Title and Description
    I_OBJTXT = 'test with pdf-Attachment!'.
    APPEND I_OBJTXT.
    DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
    READ TABLE I_OBJTXT INDEX V_LINES_TXT.
    WA_DOC_CHNG-OBJ_NAME = 'smartform'.
    WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
    WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
    WA_DOC_CHNG-SENSITIVTY = 'F'.
    WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    Main Text
    CLEAR I_OBJPACK-TRANSF_BIN.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    I_OBJPACK-BODY_NUM = V_LINES_TXT.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    APPEND I_OBJPACK.
    Attachment (pdf-Attachment)
    I_OBJPACK-TRANSF_BIN = 'X'.
    I_OBJPACK-HEAD_START = 1.
    I_OBJPACK-HEAD_NUM = 0.
    I_OBJPACK-BODY_START = 1.
    DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
    READ TABLE I_OBJBIN INDEX V_LINES_BIN.
    I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
    I_OBJPACK-BODY_NUM = V_LINES_BIN.
    I_OBJPACK-DOC_TYPE = 'PDF'.
    I_OBJPACK-OBJ_NAME = 'smart'.
    I_OBJPACK-OBJ_DESCR = 'test'.
    APPEND I_OBJPACK.
    CLEAR I_RECLIST.
    I_RECLIST-RECEIVER = '[email protected]'.
    I_RECLIST-REC_TYPE = 'U'.
    APPEND I_RECLIST.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    COMMIT_WORK = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    DOCUMENT_TYPE_NOT_EXIST = 3
    OPERATION_NO_AUTHORIZATION = 4
    PARAMETER_ERROR = 5
    X_ERROR = 6
    ENQUEUE_ERROR = 7
    OTHERS = 8.
    IF SY-SUBRC <> 0.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
    If you want to send some text as Body of the Mail then follow this once
    when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
    1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
    2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
    I_OBJPACK-TRANSF_BIN = ' '.
    I_OBJPACK-HEAD_START = 000000000000001.
    I_OBJPACK-HEAD_NUM = 000000000000001.
    I_OBJPACK-BODY_START = 000000000000002
    I_OBJPACK-BODY_NUM = 000000000000010.
    I_OBJPACK-DOC_TYPE = 'RAW'.
    append I_OBJPACK-.
    by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    DOCUMENT_DATA = WA_DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    TABLES
    PACKING_LIST = I_OBJPACK
    OBJECT_HEADER = WA_OBJHEAD
    CONTENTS_BIN = I_OBJBIN
    CONTENTS_TXT = I_OBJTXT
    RECEIVERS = I_RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    DOCUMENT_TYPE_NOT_EXIST = 3
    OPERATION_NO_AUTHORIZATION = 4
    PARAMETER_ERROR = 5
    X_ERROR = 6
    ENQUEUE_ERROR = 7
    OTHERS = 8.
    Regards
    Tamá

  • How to find Function Group

    Hi All,
            How to find Function Group for already defined Function Modules.
    Regards,

    >
    Venkat Reddy wrote:
    > Hi,
    > In addition to jayant, and MxG i will tell you one more way to
    > find the function group of a particular function group.
    > Give your function module name in SE37 and just press(Ctrl+f5) its a key for
    > copy where the function group will be display for your function module.
    > I think mine is simple
    >
    > Cheers!!
    > VEnk@
    Ctrl-f5 is the same as'Display object list Button' from Jayant Sahu.  What's funny, is that I only found this out this year and I've been doing SAP for over ten years...!

  • To find Function Code in BDC

    Hi,
    I am creating a BDC program for transaction FB09....
    How can I identify the function code for a BUTTON?
    And also, how can I know the function key number for the button?

    Hi Vin,
    go to t-code FB09>go to menu>system> status>select program-->double clcik ..
    it takes you to se38 program..
    copy program name -->go to se80 and enter the program name and enter..
    it shows you the all includes in the right hand side..
    expand the GUI status in the right hand side..
    now you will get the all gui status's according to the description doudble click and see the Fucntion key's assigned to the Buttons..
    Regards,
    Prabhudas

  • How to find workarea ID for the work area name.

    Hi Experts..
    How to find workarea ID for the work area name.(Work area name CCIHT_WAH-WAID and I want to fetch characteristic data from table AUSP matching the OBJEK field,but I only have Work area name).Can anybody help me to find tables or relationship between Workarea ID and Workarea name for the same.I am using TCODE - CHIB02.Once I select a workarea and click on IHS Data button,I get data for that workarea.I need to find where this data comes from and How is this fetched.
    Points would be rewarded for helpful answers..
    Thanks
    Kunal Halarnakar

    U want to fetch the workarea description ?
    we can fetch it from CCIHT_WALD table with the RECN value.
    The informations are stored in AUSP table with the characterstic(ATINN) value.

Maybe you are looking for

  • Display only/Grey out Delivery Schedule tab in the PO

    We are not going to use Delivery Schedule tab at all. Business wants us to Grey out the delivery schedule tab. Is it possible to make all fields under Delivery Schedule as display only? If yes, how can I do that? But, I don't want PO line qty to be g

  • CLIENT_SEND_FAILED 500 Timeout Error

    Hi Guys, i am getting below error in PI MONI, can any one please help me how to resolve this isuue. This interface is File to Proxy(ECC). <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:SAP="http

  • Toshiba Service Station question

    when i turned on my laptop today i recieved this message "one or more modules failed to load", it only has happend today and i hope it only does today.  My question is what does it mean?

  • Firefox lost my tabs

    FF4.0.1 on Win 7, i7, 3gb RAM, FF 4 is much faster than 3. I had a LOT of tabs (around 150), and a couple more in different panoramas. FF4 started getting quite slow. I shut down normally. I restarted, and all my tabs and panoramas are gone! I've loo

  • IOS RTMP live stream audio

    Hi guys hopefully some of you will be able to help me. I am trying to stream audio from a live RTMP feed using the NetConnection and NetStream classes. I've managed to get my app running no problem on Android, however I am having some major difficult