Using a function module in a search help.

People,
I make a function module for a search help. Into the function module I call a function 'K_GROUP_SELECT' that show me a screen to make another search but I don't know how can I put the value that this function return me in the field that the user click the button of the search help in my program.
This is the code that I put in the function module.
Thanks!
FUNCTION Z_GROUP_SELECT_ZFINCOKOH1_B.
*"*"Local Interface:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCT
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
*"     VALUE(SHLP) TYPE  SHLP_DESCR
tables: setheader.
data: setname type setheader-setname.
  CONSTANTS:
              CLASS         TYPE SETCLASS VALUE '0103',
              FIELD_NAME    TYPE RGSBS-FIELD  VALUE '*',
              KOKRS         TYPE TKA01-KOKRS  VALUE 'BPPR',
              KTOPL         TYPE TKA01-Ktopl VALUE 'CAPI'.
IF callcontrol-step = 'SELECT'.
*PERFORM k_group_select USING: CLASS, FIELD_NAME, KOKRS, KTOPL.
CALL FUNCTION 'K_GROUP_SELECT'
  EXPORTING
   BUTTONS                  = 'X'
   CLASS                    = CLASS
   CRUSER                   = '*'
   field_name               = FIELD_NAME
   SEARCHFLD                = '    '
   SEARCHFLD_INPUT          = 'X'
   SEARCHFLD_REQUIRED       = 'X'
   SET                      = '*'
   START_COLUMN             = 10
   START_ROW                = 5
   TABLE                    = 'CCSS'
   TYPELIST                 = 'BS'
   UPDUSER                  = '*'
   KOKRS                    = KOKRS
   KTOPL                    = KTOPL
IMPORTING
   SET_NAME                 = setname
EXCEPTIONS
   NO_SET_PICKED            = 1
   OTHERS                   = 2
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.
ENDFUNCTION.

Carlos,  Please see the following program. It is working well in my system.  The only difference is that I've implemented you function module as a subroutine instead of in a FM.   You can see that it will return the selected value back to the screen field.
report zrich_0002 .
data: setname type setheader-setname.
parameters: p_val type setheader-setname.
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
at selection-screen on value-request for p_val.
  perform f4_help.
  p_val = setname.
start-of-selection.
*       FORM f4_help                                                  *
form f4_help.
  constants: class  type setclass value '0103',
             field_name    type rgsbs-field  value '*',
             kokrs  type tka01-kokrs  value 'BPPR',
             ktopl  type  tka01-ktopl value 'CAPI'.
  call function 'K_GROUP_SELECT'
       exporting
            buttons            = 'X'
            class              = class
            cruser             = '*'
            field_name         = field_name
            searchfld          = '    '
            searchfld_input    = 'X'
            searchfld_required = 'X'
            set                = '*'
            start_column       = 10
            start_row          = 5
            table              = 'CCSS'
            typelist           = 'BS'
            upduser            = '*'
            kokrs              = kokrs
            ktopl              = ktopl
       importing
            set_name           = setname
       exceptions
            no_set_picked      = 1
            others             = 2.
endform.
REgards,
Rich HEilman

Similar Messages

  • How to use BAPI_MATERIAL_AVAILABILITY Function Module at batch level?

    How to use BAPI_MATERIAL_AVAILABILITY FM to check material available at batch level?
    And another question is what's the meaning of 'CHECK_RULE' in this FM. Thanks!

    Field name : PRREG
    fcheck more details on  f1 help...
    check_group defines the checking procedure to be used for  availability check in individual applications.
    along with the checkg group, checking rule  specifies the final procedure for chkg..
    eg:
    ST  for  stock transport order
    AQ for SD order project srock
    also chk this help doc.
    http://help.sap.com/saphelp_470/helpdata/en/cf/70124adf2d11d1b55e0000e82de178/content.htm
    search the forum for sample code..
    How to use BAPI_MATERIAL_AVAILABILITY Function Module....

  • How to use Check Function Module???

    Hi Friends,
    How to use Check Function Module in Workflow???
    My requirement is to trigger the workflow at the last line item of the Material Document.
    Rewards for sure for helpful answer.
    -Satish

    Hi Satish,
    You know, the real power of forums like these is the search functionality. First you locate the correct forum, you succeeded in that and then you locate the search field and type in your question. In your case "check function module"
    I suggest you do this right away and be amazed at all of the answers about his topic. Maybe you'll even find some topic about exactly the same issue with a different solution than check function modules and on top of that you learn something this way. Talk about win-win situation
    Kind regards, Rob Dielemans

  • Use of function module BBP_PDH_WFL_APPROVAL_SIMULATE

    Dear SAP Gurus,
    We have build a custom check in the BBP_DOC_CHECK_SC Badi to check if an approver is added to the Shopping cart.
    In case of creating a Shopping Cart we can use the function module BBP_PDH_WFL_APPROVER_CHECK to check if an approver is added.
    In case of a Shopping Cart with status held, in case of the Shopping Cart in approval or in case of the Shopping Cart is disapprvod we can't use the function module BBP_PDH_WFL_APPROVER_CHECK. Because it's not checking correctly if the approver exist.
    In those case we use the function module BBP_PDH_WFL_APPROVAL_SIMULATE to check if en approver exist in the workflow. But we encounter a problem when using this function module.
    When the requester wants to add an approver, the requester first searches for the approver and then click on add approver. Then nothing happens. The approver isn't added to the workflow and in case there was no approver anymore (after disapproving the SC) first an error message is displayed but after performing the add approver task the error message isn't displayed anymore and the approver isn't visible in the workflow.
    Add an approver is also not possible when there is already an approver of no approver and the SC is put on Held. Then the same happens. Search for approver and click on Add Approver no approver is added.
    We think this has something to do with function module BBP_PDH_WFL_APPROVAL_SIMULATE.
    Has anyone some ideas how we can solve this? Check if approver exist in the workflow and still be abble to add an approver.
    We are on SRM 4.0 with ECC 6.0 in Extended Classic Scenario.
    Thank you in advance for your replies.
    Best regards,
    Jean-Pierre

    Hi,
    In my current project, there is a requirement to forward approver to other approver.
    Something like tcode SWIA when forwarding a workitem.
    In order to list approver of particular document, I am using BBP_PDH_WFL_APPROVAL_SIMULATE to needed parameters to run following FM BBP_PDH_WFL_PARAM_APPLET_FILL2.
    From FM BBP_PDH_WFL_PARAM_APPLET_FILL2, I know whether the document has approver assigned or not.
    Hopefully can help you.

  • I have used F4IF_FIELD_VALUE_REQUEST function module.but i am not getting t

    Hi friends,
    I have 2 screen fields EQUNR & EQKTX.i have attached custom help to EQUNR.when i select value from f4 help  then i want corresponding value from search help should get populated in the EQKTX field.
    I have used F4IF_FIELD_VALUE_REQUEST function module.but i am not getting the result.
    DATA: lt_return_tab      TYPE TABLE OF ddshretval.
      DATA: lw_return_tab      TYPE ddshretval.
      DATA: lv_equnr LIKE eqkt-equnr,
            lv_eqktx LIKE eqkt-eqktx.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname                   = 'EQKT'
          fieldname                 = 'EQUNR'
          searchhelp                = 'Z_EQKT'
          SHLPPARAM                 = ' '
         dynpprog                  = sy-repid
           dynpnr                    = sy-dynnr
         dynprofield               = 'GW_SCREEN-WPTXT'
          STEPL                     = 0
          VALUE                     = ' '
          MULTIPLE_CHOICE           = 'X'
          DISPLAY                   = ' '
          SUPPRESS_RECORDLIST       = ' '
          CALLBACK_PROGRAM          = ' '
          CALLBACK_FORM             = ' '
          SELECTION_SCREEN          = ' '
        IMPORTING
          USER_RESET                =
       TABLES
         return_tab                = lt_return_tab
        EXCEPTIONS
          FIELD_NOT_FOUND           = 1
          NO_HELP_FOR_FIELD         = 2
          INCONSISTENT_HELP         = 3
          NO_VALUES_FOUND           = 4
          OTHERS                    = 5
      IF sy-subrc = 0.
        READ TABLE lt_return_tab INTO lw_return_tab INDEX 1.
        IF sy-subrc = 0.
         MOVE lw_return_tab-fieldval TO lv_equnr.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = lw_return_tab-fieldval
            IMPORTING
              output = lv_equnr.
          SELECT SINGLE eqktx
            INTO lv_eqktx
            FROM eqkt
            WHERE equnr = lv_equnr AND
                  spras = sy-langu.
          IF sy-subrc = 0.
            gw_screen-wptxt = lv_eqktx.
            gw_screen-equnr = lv_equnr.
          ENDIF.
        ENDIF.
      ENDIF.
    Please provide the solution.

    I have written the same code as you said but still its not giving me the equnr value.
    DATA :  lt_dynpread1        TYPE STANDARD TABLE OF dynpread,
              lt_dynpread11       TYPE STANDARD TABLE OF dynpread,
              lw_dynpread1        LIKE LINE  OF lt_dynpread1,
              lw_dynpread11       LIKE LINE  OF lt_dynpread11,
              lt_return_tab1      TYPE TABLE OF ddshretval,
              lw_return_tab1      TYPE ddshretval,
              lv_equnr1           LIKE eqkt-equnr,
              lv_eqktx1           LIKE eqkt-eqktx,
             lt_eqkt            TYPE STANDARD TABLE OF eqkt,
              li_dselc       TYPE STANDARD TABLE OF dselc,
               lwa_dselc      TYPE dselc.
      TYPES: BEGIN OF lty_eqkt,
            equnr TYPE eqkt-equnr,
            eqktx TYPE eqkt-eqktx,
            END OF lty_eqkt.
      DATA: lt_eqkt TYPE TABLE OF lty_eqkt,
            li_dynpread    TYPE STANDARD TABLE OF dynpread,
            lwa_dynpread   TYPE dynpread.
      DATA:
            lg_condition    TYPE string.
      TYPES: BEGIN OF lty_eqktx,
               sign(1)   TYPE c,
               option(2) TYPE c,
               low       TYPE eqkt-eqktx,
               high      TYPE eqkt-eqktx,
              END OF lty_eqktx.
      DATA: lt_eqktx TYPE STANDARD TABLE OF lty_eqktx.
      DATA:lw_eqktx TYPE lty_eqktx.
      lwa_dynpread-fieldname = 'GW_SCREEN-WPTXT'.
      APPEND lwa_dynpread TO li_dynpread.
      CLEAR lwa_dynpread.
    Read Screen Field Values.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = sy-repid
          dynumb     = sy-dynnr
        TABLES
          dynpfields = li_dynpread.
    Read the first record as only one record will be present
      READ TABLE li_dynpread INTO lwa_dynpread INDEX 1.
      gw_screen-wptxt = lwa_dynpread-fieldvalue.
      CLEAR lw_eqktx.
      lw_eqktx-sign = 'I'.
      lw_eqktx-option = 'CP'.
      lw_eqktx-low = gw_screen-wptxt.
      APPEND lw_eqktx TO lt_eqktx.
      CLEAR lw_eqktx.
      IF gw_screen-wptxt IS INITIAL.
        SELECT equnr eqktx
             INTO TABLE lt_eqkt
             FROM eqkt.
      ELSE.
       MOVE 'EQKTX CP GW_SCREEN-WPTXT' TO lg_condition.
    *lg_condition = GW_SCREEN-WPTXT.
        SELECT  equnr eqktx
             INTO TABLE lt_eqkt
             FROM eqkt
          WHERE eqktx IN lt_eqktx.
      ENDIF.
      lwa_dselc-fldname = 'F0002'.
      lwa_dselc-dyfldname = 'GW_SCREEN-WPTXT'.
      APPEND lwa_dselc TO li_dselc.
      CLEAR lwa_dselc.
      lwa_dselc-fldname = 'F0003'.
      lwa_dselc-dyfldname = 'GW_SCREEN-EQUNR'.
      APPEND lwa_dselc TO li_dselc.
      CLEAR lwa_dselc.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
      DDIC_STRUCTURE         = ' '
          retfield               = 'GW_SCREEN-WPTXT'
      PVALKEY                = ' '
          dynpprog          = sy-repid
          dynpnr            = sy-dynnr
          dynprofield            = 'GW_SCREEN-WPTXT'
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
          value_org              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
        TABLES
          value_tab              = lt_eqkt
      FIELD_TAB              =
          return_tab             = lt_return_tab1
          dynpfld_mapping        = li_dselc
    EXCEPTIONS
       parameter_error        = 1
       no_values_found        = 2
       OTHERS                 = 3

  • How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display

    Hi experts..
    i got one requirement like i need to edit some rows particularly in alv....
    Edit in alv output....is it possible to get  that .....using normal function module with out using oops concept...
    could any one pls help me...

    Hi Pendurti ,
    If you want a particular field to be editable , simply define the fieldcatalog as
    wa_fieldcatalog-edit          = 'X'.
    wa_fieldcatalog-input         = 'X'.
    for that field.
    and
    Now when you use FM ' Reuse alv grid display '
    define USER_COMMAND
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = v_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = int_fieldcatalog
          is_layout                = wa_layout
        TABLES
          t_outtab                 = t_disp.
    and now in form USER_COMMAND ; code as per following
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                                rs_selfield TYPE slis_selfield.
         DATA ref1 TYPE REF TO cl_gui_alv_grid.
         CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
             e_grid = ref1.
         CALL METHOD ref1->check_changed_data.
    endform.
    Regards,
    Yogendra Bhaskar

  • Issue with use of Function Module GUI_UPLOAD

    Hi Experts,
    I have an issue in using the Function Module GUI_UPLOAD for uploading the contents of an Excel file on the Presentation Server to an internal table in an ABAP Program.
    My file consists of around 300 records but the FM succeeds in uploading only the first 6 lines to the Internal Table specified while calling the FM.
    I dont have any idea why this happens. Any pointers in this direction will be helpful.
    Thanks in advance.
    Regards,
    Keerthi

    Hi,
    Kindly go through this link below:
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=60655105
    Hope it helps you
    Regards
    Mansi

  • How to use these function modules

    Hi all,
    can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
    1. FC_USER_AUTHORITY_CHECK
    <b>2. FC_USER_STATUS_CHECK
    3. FC_USER_STATUS_UPDATE</b>
    4. FC_USER_GET_CACTI
    5. FC_USER_CHECK_FOR_OUTPUT
    Thanks in Advance
    Ganesh

    Hi Rob,
    thanks for ur reply,
    but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
    but how do i populate them.. i am not getting that..
    thanks
    ganesh

  • How to use ADD_MAINTAIN_COMPLETE function module

    how to use ADD_MAINTAIN_COMPLETE function module
    please help me.
    by using the above function module
    how can i change the ADRT table REMARK field

    how to use ADD_MAINTAIN_COMPLETE function module
    please help me.
    by using the above function module
    how can i change the ADRT table REMARK field

  • Using a function module in ABAP Query

    Hi All,
    I want to use a function module in ABAp query in the Record Processing Section.
    In the report program we click on Pattern button to inser the function module so that all the Importing and exporting parameter automatically appears.
    Similarly is there any particular method of inserting a function module in ABAp Query.
    Regards
    Manipal Parkala

    When you are doing the infoset for the query (SQ02) you can add coding by clicking the coding tab. You can chose in wich event you want your coding and there is Pattern Button for  you to easy use.
    If you don't want to put the code in the infoset just in the query then is not posible.
    Nevertheless, I higly descourage the use of coding in queryies. If you need to insert some coding make an ALV its easier, clearer and much easier to mantain.
    Hope it helps.

  • Get purchase order doc date using BAPI function module

    Hi,
    I have a .net windows application that uses BAPI_PO_GETDETAIL function module to get particular details of a PO in SAP. But i am not able to get the "Doc Date" for a particular PO. I am able to get all the details of items from the table "PO_ITEMS ". I used only 1 input parameter "PURCHASEORDER".
    Please help me to get this thing done
    .netframework : 4.0
    Language: C#
    Visual Studio: vs 2010
    Regards,
    Manosh Jacob

    Absolutely hynek petrak..
    Manosh Jacob You can go with the above technique.

  • Using CREATE_TEXT function module in LSMW for Tcode: FD32

    Hi Friends,
    I have to upload texts to the transaction FD32 via LSMW by using
    CREATE_TEXT function module. If anyone has worked on this before
    then please clarify the following doutb.
    In which event (Begin of record, End of transaction etc)   I have to write the code?
    Any sample code snippet for this requiremen would be helpful to me.
    Thanks in Advance
    Murthy

    Hi,
    Thanks for your responses.
    I had found the solution on my own.
    Thanks
    Murthy

  • How to Use ECC function Module

    Hi Experts - We need to execute the function module in ECC and need to write data in Oracle table.
    We are using BODS 4.0.
    How to use function module in data flow ? how it can work as a source ?
    I just need some basic steps how to use function module as a source and do the transformation to target.
    Thanks
    R

    Hi Ashwani,
    It is still not possible to use a FM as a source in DS.
    You can use a FM in a transformation but you have to start from a file or table as a source and load into a target (a FM can not be an end point of a dataflow - as it is used in the transformation and each transformation requires a source and a target.
    The scenario I described above was based on a situation where you have a source (flat file or table) and want to use a Function Module to transform your data and/or load the data in a transparant table in SAP.
    Your scenario is different, as your source is not a table/ff but a FM.
    In your case, I can see two scerio's:
    - Use an ABAP dataflow. Although I haven't got any experience with this I do believe this would be an option for your scenario. Please referer to the Data Services documentation on ABAP dataflows for further guidance.
    - As suggested earlier, you can create a bespoke (BW) Datasource based on a Function Module. Please refer to SAP help for creating a generic datasource:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
    Depending on your scenario there might be a third option:
    - Use a SAP transparant table as a source. Create a transformation into the designated Oracle table. In the transformation call a FM which executes whatever logic you require. This solution will work if you have a table which produces the same number of records as your FM. If your function module produces more or less records (than there are in the transparant table), then this might become a bit tricky. It might work, but I have never tried it.
    Instead of a transparant table you can also use a table join, obviously. Perhaps part of the complexity of your FM could be resolved by using a join and you can create a new simpler FM for the remaining logic?
    Good luck,
    Jan.

  • How to use the function module which i mentioned, to store the pdf files

    hi,
    SO_NEW_DOCUMENT_ATT_SEND_API1
    I am using above function module to send employ details through mail in pdf format, if i want to store that pdf files in a local computer too, then how should i catch hold off those individual pdf files of all employees, plz help me out with a sample code

    hey iam from functional side can u be little bit clear of that feature
    thanks
    sikindar

  • How can we use SX_OBJECT_CONVERT_OTF_INTO_PDF function module IN SCRIPT

    Hi Gurus,
    can any one inform me,how to use  SX_OBJECT_CONVERT_OTF_INTO_PDF  function module in script..
    how can we convert  the script output into pdf file format....
    i need your help......plz
    my mail id : [email protected] 
    Thanks,
    Rajkumar.A
    Edited by: rajkumar annadurai on Feb 19, 2008 10:25 AM

    Hi, Dear
    In XI 3.0 we are tyring to setup SAPconnect;
    1 Step; Create RFC connection for Mlunxsnd file, anyway!!! we download thease file and create RFC connection; fine working no error
    2 Step: Create Nodes T-code SCOT => connection INT => and support address type like Internet its just show only "PDF, HTM, TXT" thats it its not show some others format
    3. Step; When check email T-code SOST Getting an error messages: "Connot process message in node, parameters cannot be converted"
    4. In R3 RPD and Others system when I check format its ok its show some others format which is support to be such as "ALI, OBJ, OTF, SCR, URL" ...
    How may install these format in XI 3.0
    Please Advice I will be really appriciated
    Thanks a lot
    Travis

Maybe you are looking for

  • Time Stamp Error while extracting data from R/3

    Hi,     We are getting time stamp error while extracting data from R/3. To solve this problem we did replication and run RS_TRANSTRU_ACTIVATE_ALL program. still we are facing same problem. Please suggest me to solve. Thanks Subba Rao

  • Incomplete Recovery Fails using Full hot backup & Archive logs !!

    Hello DBA's !! I am doing on Recovery scenario where I have taken One full hot backup of my Portal Database (EPR) and Restored it on New Test Server. Also I restored Archive logs from last full hot backup for next 6 days. Also I restored the latest C

  • Why do we use static block ????

    my question is that why do we use static block for certain statements and declarations ?? what advantage do they hold??? Please help me........

  • Trigger Navigation an iView/Page from Portal component

    All, I am writing AbstractPortalComponent and after performing some logic, I have to forward the control to a iView/Page. Please let me know how I can trigger navigation to a iView/Page from within AbstractPortalComponent. Thanks, Prasad

  • Resolving type names during compilation

    Hi, I have a question about how the default (or any other) java compiler resolves type names when compiling several files. How does the compiler efficiently organise itself so that it can resolve type names that it has not yet parsed? take a trivial