Use of function module RHPD_SEARCH_PEOPLE_WITH_QUAL

Hello Gurus,
I am currently working on HR module. I want to know how RHPD_SEARCH_PEOPLE_WITH_QUAL is used. I am not able to figure out as i don't have system to work on. Just conceptual information is enough(code will be handy too). but a rough draft will do.
Thanks in advance.
Thanks and Regards,
Saurabh Chhatre

Hi,
The code is below
* CORRECTIONS
* DATE       CORRECTION NOTE    DESCRIPTION
* 06.03.2001 L9CK045041 0387320 Selection of applicants
* 11.06.2001 L9CK055799 0411739 Wrong search for Applicants in TA: PBAP
FUNCTION rhpd_search_people_with_qual .
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(PLVAR) LIKE  HRP1000-PLVAR
*"     VALUE(BEGDA) LIKE  HRP1000-BEGDA DEFAULT SY-DATUM
*"     VALUE(ENDDA) LIKE  HRP1000-ENDDA DEFAULT SY-DATUM
*"     VALUE(SUBTY) LIKE  HRP1001-SUBTY DEFAULT 'B032'
*"     VALUE(GET_PERS_NAME) LIKE  SY-INPUT DEFAULT 'X'
*"     VALUE(ONLY_ESSENTIAL) TYPE  ESSENTIAL OPTIONAL
*"     VALUE(CONSIDER_ALTQ) TYPE  SUBSTITUTE OPTIONAL
*"     VALUE(TARGET_AP_IEA) LIKE  SY-INPUT DEFAULT ' '
*"  TABLES
*"      QUALI_TAB STRUCTURE  QUALI_PROF
*"      IMP_PERS_TAB STRUCTURE  HRSOBID OPTIONAL
*"      PERS_TAB STRUCTURE  PERSQ_PROF
*"      ALTQ_TAB STRUCTURE  ALTQ_STRU OPTIONAL
*"      APSTA_RANGE STRUCTURE  RANGE_APSTA OPTIONAL
*"      TARGET_OTYPE_TAB STRUCTURE  HROTYPE OPTIONAL
*"  EXCEPTIONS
*"      NO_QUALIFICATION
*"      NO_PERSON_FOUND
  DATA: adata.
  DATA: objects LIKE hrobject OCCURS 1 WITH HEADER LINE.
  DATA: sobjects LIKE hrsobid OCCURS 1 WITH HEADER LINE.
  DATA: i1001 LIKE p1001 OCCURS 1 WITH HEADER LINE.
  DATA: sobid LIKE i1001-sobid.
  DATA: BEGIN OF persons OCCURS 1,
             sclas LIKE i1001-sclas,
             sobid LIKE i1001-sobid.
  DATA: END OF persons.
  DATA: pad31 LIKE pad31.
  DATA: ok_flag.
  DATA: l_otype like hrobject-otype.
  DATA: conditions LIKE hrcond OCCURS 1 WITH HEADER LINE.
  DATA: condition_id LIKE hrrhdb-condition.
  DATA: h_no_persons.
  ranges: only_otype for objec-otype.
  DATA: h_tabix like sy-tabix.
  DATA: t77eo_prog LIKE t77eo-prog.
  data: l_function_module like rs38l-name.
  Field-symbols: <i1001-adata>. "LudwigUNI
* read t77s0 parameters
  PERFORM read_t77s0_parameters_for_pe.
* nur bei "erfüllt"-Verknüpfung Zusatzdaten (Ausprägung) lesen
  IF subty+1(3) = $ownsb+1(3).         " '032' erfüllt
    adata = 'X'.
  ENDIF.
* Tabelle für read_infty füllen
  LOOP AT quali_tab.
    objects-plvar = plvar.
    objects-otype = $quali.
    objects-objid = quali_tab-qualid.
    APPEND objects.
  ENDLOOP.
  IF sy-subrc > 0.
    RAISE no_qualification.
  ENDIF.
* Export-Tabelle leeren
  CLEAR pers_tab.
  REFRESH pers_tab.
* Wenn der Paramter target_iea gesetzt ist, wird die Tabelle
* Target_otype_tab entsprechend gefüllt ( Doku zu Parameter beachten )
  IF NOT target_ap_iea IS INITIAL.
    READ TABLE target_otype_tab WITH KEY otype = $pernr.
    IF sy-subrc NE 0.
      h_no_persons = 'X'.
    ENDIF.
    IF target_ap_iea EQ 'A' OR target_ap_iea EQ 'I'
      OR target_ap_iea EQ 'E'.
      target_otype_tab-otype = $pernr.
      APPEND target_otype_tab.
    ENDIF.
    IF target_ap_iea EQ 'A' OR target_ap_iea EQ 'E'.
      target_otype_tab-otype = $applk.
      APPEND target_otype_tab.
    ENDIF.
    SORT target_otype_tab BY otype.
    DELETE ADJACENT DUPLICATES FROM target_otype_tab.
  ENDIF.
* Für binary search
  SORT target_otype_tab.
* INSERT by XSC *****
*  READ TABLE imp_pers_tab INDEX 1 TRANSPORTING NO FIELDS.
*  IF sy-subrc = 0.
* Falls Zielpersonen schon bekannt sind, Bedingungen aufbauen
*    REFRESH conditions.
*    CLEAR conditions.
* Einschränkung auf Zielobjekttypen
*    LOOP AT imp_pers_tab.
*      READ TABLE target_otype_tab WITH KEY otype = imp_pers_tab-otype
*                                       BINARY SEARCH.
*      IF sy-subrc EQ 0.
*        conditions-field = 'SCLAS'.
*        conditions-opera = 'EQ'.
*        conditions-low   = imp_pers_tab-otype.
*        APPEND conditions.
*        conditions-field = 'SOBID'.
*        conditions-opera = 'EQ'.
*        conditions-low   = imp_pers_tab-sobid.
*        APPEND conditions.
*      ELSE.
*       is there any entry in target otype table
*        READ TABLE target_otype_tab INDEX 1 TRANSPORTING NO FIELDS.
*        IF sy-subrc <> 0.
*         there is no entry -> TAKE ALL object types !!!
*          conditions-field = 'SCLAS'.
*          conditions-opera = 'EQ'.
*          conditions-low   = imp_pers_tab-otype.
*          APPEND conditions.
*          conditions-field = 'SOBID'.
*          conditions-opera = 'EQ'.
*          conditions-low   = imp_pers_tab-sobid.
*          APPEND conditions.
*        ENDIF.                         "any entry in target otype ?
*      ENDIF.                           "allowed in target otype table ?
*    ENDLOOP.
* INSERT by XSC *****
  READ TABLE imp_pers_tab INDEX 1 TRANSPORTING NO FIELDS.
  IF sy-subrc = 0.
* Falls Zielpersonen schon bekannt sind, Bedingungen aufbauen
    REFRESH conditions.
    CLEAR conditions.
* INSERT by Ludwig *****
    Loop at imp_pers_tab.
      if l_otype = imp_pers_tab-otype.
        continue.
      else.       "l_otype <> im_pers_tab-otype = new objecttype
        only_otype-sign   = 'I'.
        only_otype-option = 'EQ'.
        only_otype-low    = imp_pers_tab-otype.
        append only_otype.
        l_otype = imp_pers_tab-otype.
      endif.
    endloop.
    delete target_otype_tab where not otype in only_otype.
    LOOP AT target_otype_tab.
      conditions-field = 'SCLAS'.
      conditions-opera = 'EQ'.
      conditions-low   = target_otype_tab-otype.
      APPEND conditions.
    ENDLOOP.
* Verknüpfungsart:
    conditions-field = 'SUBTY'.
    conditions-opera = 'EQ'.
    conditions-low = subty.
    APPEND conditions.
* Zeitraumeingrenzung übernehmen
    conditions-field = 'BEGDA'.
    conditions-opera = 'LE'.
    conditions-low = endda.
    APPEND conditions.
    conditions-field = 'ENDDA'.
    conditions-opera = 'GE'.
    conditions-low = begda.
    APPEND conditions.
* Bedingungstabelle für select generieren
    CALL FUNCTION 'RH_CONDITION_BUILD'
         EXPORTING
              infty            = '1001'
         IMPORTING
              condition        = condition_id
         TABLES
              condtab          = conditions
         EXCEPTIONS
              empty_condtab    = 1
              no_db_field      = 2
              unknown_infty_db = 3
              wrong_condition  = 4
              unknown_pad_db   = 5
              OTHERS           = 6.
    IF sy-subrc NE 0.
      RAISE no_person_found.
    ENDIF.
* Passende Objekte suchen. Extend = 'D' -> Conditions beachten
    CALL FUNCTION 'RH_READ_INFTY_1001'
         EXPORTING
*               AUTHORITY       = 'DISP'
*               WITH_STRU_AUTH  = 'X'
*               ISTAT           = ' '
              extend          = 'D'
*             subty           = subty
*             begda           = begda
*             endda           = endda
              condition       = condition_id
*               SORT            = 'X'
*               WITH_EV         = ' '
              adata           = adata
         TABLES
              i1001           = i1001
              objects         = objects
         EXCEPTIONS
              nothing_found   = 1
              wrong_condition = 2
              OTHERS          = 3.
    IF sy-subrc NE 0.
      RAISE no_person_found.
    ENDIF.
* Bedingung wieder löschen
    CALL FUNCTION 'RH_CONDITION_DELETE'
         EXPORTING
              condition = condition_id
         EXCEPTIONS
              OTHERS    = 0.
* INSERT by Ludwig *****
    read table imp_pers_tab index 1 transporting no fields.
    if sy-subrc = 0.
*    The found persons in the table persons are all persons which
*    have a valid qualification.
*    Delete persons out of table persons which not belong to the
*    organization_unit.
*    Sort table persons by otype objectid objecttext qualiid and date
      sort imp_pers_tab by plvar otype sobid.
      clear h_tabix.
      loop at i1001.
        h_tabix = sy-tabix.
        read table imp_pers_tab with key otype  = i1001-sclas
                                         sobid  = i1001-sobid
                                         binary search.
        if sy-subrc <> 0.       "person not in the organzation_unit
          delete i1001 index h_tabix.  "delete person out of i1001
        endif.
      endloop.
    endif.                             "imported persons
* INSERT by XSC *****
  ELSEIF ( target_ap_iea EQ 'I' ) OR
         ( target_ap_iea EQ 'E' ) OR
         ( target_ap_iea EQ 'A' ).
* Sonderbehandlung für Bewerber, falls da : (für Bewerberverwaltung)
    LOOP AT target_otype_tab.  "Correction L9CK055799 0411739 11.06.2001
* Dynamisches Form zur Bewerberstatuseinschränkung lesen:
      SELECT SINGLE * FROM t77eo WHERE otype = $applk.
      t77eo_prog = t77eo-prog.
* Status der Bewerber beim RH_READ_OBJECT berücksichtigen:
      READ TABLE apsta_range INDEX 1 TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        PERFORM set_apsta IN PROGRAM (t77eo_prog) TABLES apsta_range
                                  USING begda endda    IF FOUND.
      ENDIF.
    ENDLOOP.
* Bedingungen aufbauen
    REFRESH conditions.
    CLEAR conditions.
* Einschränkung auf Zielobjekttyp:
*    IF target_ap_iea eq 'A' or         "Alle Bewerber selektieren
*       target_ap_iea = 'E'.            "externe Bewerber selektieren
*      conditions-field = 'SCLAS'.
*      conditions-opera = 'EQ'.
*      conditions-low = $applk.         "Bewerber:
*      APPEND conditions.
*    ENDIF.
*    IF target_ap_iea eq 'A' or         "Alle Bewerber selektieren
*       target_ap_iea = 'I'.            "interne Bewerber selektieren
*      conditions-field = 'SCLAS'.
*      conditions-opera = 'EQ'.         "Personen auslesen:  ! Rollen-
*      conditions-low = $pernr.         "interner Bewerber   ! konzept
*      APPEND conditions.
*    ENDIF.
    LOOP AT target_otype_tab.
      conditions-field = 'SCLAS'.
      conditions-opera = 'EQ'.
      conditions-low   = target_otype_tab-otype.
      APPEND conditions.
    ENDLOOP.
* Verknüpfungsart:
    conditions-field = 'SUBTY'.
    conditions-opera = 'EQ'.
    conditions-low = subty.
    APPEND conditions.
* Zeitraumeingrenzung übernehmen - Anfang Quali vor Ende Zeitraum
    conditions-field = 'BEGDA'.
    conditions-opera = 'LE'.
    conditions-low = endda.
    APPEND conditions.
    conditions-field = 'ENDDA'.
    conditions-opera = 'GE'.
    conditions-low = begda.
    APPEND conditions.
    CALL FUNCTION 'RH_CONDITION_BUILD'
         EXPORTING
              infty            = '1001'
         IMPORTING
              condition        = condition_id
         TABLES
              condtab          = conditions
         EXCEPTIONS
              empty_condtab    = 1
              no_db_field      = 2
              unknown_infty_db = 3
              wrong_condition  = 4
              unknown_pad_db   = 5
              OTHERS           = 6.
    IF sy-subrc NE 0.
      RAISE no_person_found.
    ENDIF.
* Extend = 'D' -> Conditions beachten
    CALL FUNCTION 'RH_READ_INFTY_1001'
         EXPORTING
*               AUTHORITY       = 'DISP'
*               WITH_STRU_AUTH  = 'X'
*               ISTAT           = ' '
              extend          = 'D'
*              subty           = subty
*              begda           = begda
*              endda           = endda
              condition       = condition_id
*               SORT            = 'X'
*               WITH_EV         = ' '
              adata           = adata
         TABLES
              i1001           = i1001
              objects         = objects
         EXCEPTIONS
              nothing_found   = 1
              wrong_condition = 2
              OTHERS          = 3.
*   applicant selection !
    l_function_module = 'RHPD_DC_INTERPRET_TARGET_IEA'.
    CALL FUNCTION 'FUNCTION_EXISTS'                  "XSC DC
      EXPORTING
        FUNCNAME                 = l_function_module
      EXCEPTIONS
        FUNCTION_NOT_EXIST       = 1
        OTHERS                   = 2.
    IF SY-SUBRC = 0.
*     HR SYSTEM
      CALL FUNCTION l_function_module
        EXPORTING
          TARGET_AP_IEA          = TARGET_AP_IEA
        TABLES
          I1001                  = i1001.
    else.
*     NO HR SYSTEM
*     -> no applicant selection or determination
    ENDIF.
  ELSE.
* Einschränkung auf Zielobjekttypen ungleich Bewerber:
* Ist jetzt nahezu das gleiche wie bei target_ap_iea ne space. Aber
* weil's dann übersichtlicher bleibt, steht's halt nochmal extra.
* Bedingungen aufbauen
    CLEAR conditions.
    REFRESH conditions.
* Einschränkung auf Zielobjekttypen: ( Sobids sind nicht bekannt )
    LOOP AT target_otype_tab.
      conditions-field = 'SCLAS'.
      conditions-opera = 'EQ'.
      conditions-low = target_otype_tab-otype.
      APPEND conditions.
    ENDLOOP.
* Verknüpfungsart:
    conditions-field = 'SUBTY'.
    conditions-opera = 'EQ'.
    conditions-low = subty.
    APPEND conditions.
* Zeitraumeingrenzung übernehmen
    conditions-field = 'BEGDA'.
    conditions-opera = 'LE'.
    conditions-low = endda.
    APPEND conditions.
    conditions-field = 'ENDDA'.
    conditions-opera = 'GE'.
    conditions-low = begda.
    APPEND conditions.
    CALL FUNCTION 'RH_CONDITION_BUILD'
         EXPORTING
              infty            = '1001'
         IMPORTING
              condition        = condition_id
         TABLES
              condtab          = conditions
         EXCEPTIONS
              empty_condtab    = 1
              no_db_field      = 2
              unknown_infty_db = 3
              wrong_condition  = 4
              unknown_pad_db   = 5
              OTHERS           = 6.
    IF sy-subrc NE 0.
      RAISE no_person_found.
    ENDIF.
    CALL FUNCTION 'RH_READ_INFTY_1001'
         EXPORTING
*               AUTHORITY       = 'DISP'
*               WITH_STRU_AUTH  = 'X'
*               ISTAT           = ' '
              extend          = 'D'
              subty           = subty
              begda           = begda
              endda           = endda
              condition       = condition_id
*               SORT            = 'X'
*               WITH_EV         = ' '
              adata           = adata
         TABLES
              i1001           = i1001
              objects         = objects
         EXCEPTIONS
              nothing_found   = 1
              wrong_condition = 2
              OTHERS          = 3.
    IF sy-subrc NE 0.
      RAISE no_person_found.
    ENDIF.
  ENDIF.
* Die Bedingungen wieder löschen
  CALL FUNCTION 'RH_CONDITION_DELETE'
       EXPORTING
            condition = condition_id
       EXCEPTIONS
            OTHERS    = 0.
* Wenn nur Personen gefunden werden sollen, die auf jeden Fall einen
* Teil der Qualis (Mußanforderungen) haben,
* müssen die Personen wieder rausgeschmissen werden, die nicht diese
* Qualifikationen erfüllen.
  IF only_essential = 'X'.
*   Zunächst alle gefundenen Personen ermitteln:
    LOOP AT i1001.
      persons-sclas = i1001-sclas.
      persons-sobid = i1001-sobid.
      APPEND persons.
    ENDLOOP.
    SORT persons BY sclas sobid.       "Schneller als
    DELETE ADJACENT DUPLICATES FROM persons.   "collect
*   Dann die Personen wieder rausschmeißen, die nicht alle MußQ's haben:
    LOOP AT persons.
      LOOP AT quali_tab WHERE essential = 'X'.
        READ TABLE i1001 WITH KEY objid = quali_tab-qualid
                                  sclas = persons-sclas
                                  sobid = persons-sobid.
        IF sy-subrc > 0.               "Person hat Quali nicht
          IF consider_altq IS INITIAL. "ErsatzQ nicht beachten
            DELETE persons.            "also Person rausscheißen
            EXIT.
          ELSE. " consider_altq = 'X'  SUCHE NACH ERSATZQUALIFIKATIONEN
            CLEAR ok_flag.
            LOOP AT altq_tab WHERE robid = quali_tab-qualid.
              READ TABLE i1001 WITH KEY objid = altq_tab-tobid
                                        sclas = persons-sclas
                                        sobid = persons-sobid.
              IF sy-subrc = 0.         "Person hat ErsatzQ
                ok_flag = 'X'.
                EXIT.
              ENDIF.
            ENDLOOP.
            IF ok_flag IS INITIAL.
              DELETE persons.
              EXIT.
            ENDIF.
          ENDIF.  "consider_altq is initial. "ErsatQ beachten
        ENDIF.  "sy-subrc > 0.      "Person hat Quali nicht
      ENDLOOP.                         " at quali_tab
    ENDLOOP.                           " at persons.
* Und noch die i1001 bereinigen:
    LOOP AT i1001.
      READ TABLE persons WITH KEY sclas = i1001-sclas
                                  sobid = i1001-sobid.
      IF sy-subrc > 0. "Person nicht in persons => in i1001 löschen
        DELETE i1001.
      ENDIF.
    ENDLOOP.
  ENDIF.                               " only_essential = 'X'
* Wenn Namen gewünscht, Text_buffer füllen.
  IF NOT get_pers_name IS INITIAL.
    LOOP AT i1001.
      sobjects-plvar = plvar.
      sobjects-otype = i1001-sclas.
      sobjects-sobid = i1001-sobid.
      APPEND sobjects.
    ENDLOOP.
    CALL FUNCTION 'RH_TEXT_BUFFER_FILL_EXTERNAL'
*        EXPORTING
*             CHECK_STRU_AUTH = 'X'
         TABLES
              objects         = sobjects
         EXCEPTIONS
              OTHERS          = 0.
  ENDIF. " get_pers_name = 'X'.                                        .
* Fülle Pers_tab.
  LOOP AT i1001.
    CLEAR pers_tab.
    pers_tab-otype = i1001-sclas.
    pers_tab-sobid = i1001-sobid.
    IF get_pers_name = 'X'.
      sobid = i1001-sobid.
      CALL FUNCTION 'RH_READ_OBJECT'
           EXPORTING
                plvar           = plvar
                otype           = i1001-sclas
*               objid           = objid
                realo           = sobid
*               ISTAT           = ' '
                begda           = begda
                endda           = endda
*               LANGU           = SY-LANGU
*               OINTERVAL       = 'X'
*               STORE           = 'X'
*               CHECK_STRU_AUTH = 'X'
*               READ_DB         = ' '
           IMPORTING
*                obeg            =
*                oend            =
*                ostat           =
*                histo           =
                 short           = pers_tab-short
                 stext           = pers_tab-stext
           EXCEPTIONS
                not_found       = 1
                OTHERS          = 2.
      IF sy-subrc > 0.
        CONTINUE.
      ENDIF.
    ENDIF.
    IF pers_tab-stext IS INITIAL.
      pers_tab-stext = pers_tab-short.
    ENDIF.
    pers_tab-qualid = i1001-objid(8).
    READ TABLE quali_tab WITH KEY qualid = i1001-objid(8).
    pers_tab-qualstxt  = quali_tab-qualstxt.
    pers_tab-essential = quali_tab-essential.
    assign i1001-adata to <i1001-adata> casting type c. "LudwigUNI
    pad31 = <i1001-adata>.
*   get proficiency for the qualification                in the future:
*   profile-profcy = pad31-chara / 10000000           "for NUMC8
    pers_tab-profcy = pad31-chara.
*   Verknüpfungszeitraum füllen:
    pers_tab-vbegda = i1001-begda.
    pers_tab-vendda = i1001-endda.
    APPEND pers_tab.
  ENDLOOP.
* Einschränkung des Bewerberstatus zurücknehmen:
  IF target_ap_iea EQ 'I' OR
     target_ap_iea EQ 'E' OR
     target_ap_iea EQ 'A'.
    LOOP AT target_otype_tab WHERE otype = $applk.
      PERFORM reset_apsta IN PROGRAM (t77eo_prog) IF FOUND.
    ENDLOOP.
  ENDIF.
ENDFUNCTION.
Regards,
Shailaja

Similar Messages

  • How to use read_text function module

    Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
    thanks,
    Mahe

    Dear,
    Use below code.
    DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
    V_TDNAME LIKE THEAD-TDNAME.
    V_TDNAME = PO_NUMBER.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        ID                            = 'F01'
        LANGUAGE                      = 'EN'
        NAME                          = V_TDNAME
        OBJECT                        = 'EKKO'
      TABLES
        LINES                         = IT_LINE.
    Thanks and Regards,

  • How to avoid use of function module in case of background jobs?

    Hi ,
           I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file  through bapi , send the  result in their respective server. This program should run through batch jobs in background mode.
    I am using following function module :
      SUBST_GET_FILE_LIS : Get the file list from application server
    TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
    GUI_UPLOad : to extract file data   from presentation server
    GUI_downLOAD : to download data  to presentation server
    in case of background job these function modules will not work.... so how to resolve this issue...
    what are the methods we can apply?
    Thanks & Regards
    Sandeep

    Hi,
    This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server.  There is no way , by which you can process presentation server files in background mode.
    Regards
    Vinod

  • How can i use reuse_alv_fieldcatalog_merge function module

    I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
    FORM BUILD_FIELDCATALOG .
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'KUNNR'.
      FIELDCAT-SELTEXT_M = 'Customer Name'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VBELN'.
      FIELDCAT-SELTEXT_M = 'Invoice Reference'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKBUR'.
      FIELDCAT-SELTEXT_M = 'Sales Office'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKGRP'.
      FIELDCAT-SELTEXT_M = 'Sales Person'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'POSNR'.
      FIELDCAT-SELTEXT_M = 'Item No'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FIANL'.
      FIELDCAT-FIELDNAME = 'ARKTX'.
      FIELDCAT-SELTEXT_M = 'Item Description'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.

    Hello,
    It is very easy to use reuse_alv_fieldcatalog_merge.
    You try this it will work.
    example
    data:
    DATA : gv_repid        TYPE syrepid VALUE sy-repid .  " Report id
      PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
    FORM set_field_catalog  USING uv_tab TYPE slis_tabname
                         CHANGING  xt_fieldcatalog TYPE slis_t_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = gv_repid
          i_internal_tabname     = uv_tab
          i_inclname             = gv_repid
        CHANGING
          ct_fieldcat            = xt_fieldcatalog
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 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.
    ENDFORM.                    " set_field_catalog_spec

  • Sending mails to UWL using SO_NEW_DOCUMENT_ATT_SEND_API1 function module

    Hi all,
    is it possible to view mails send using SO_NEW_DOCUMENT_ATT_SEND_API1 function module to UWL?
    I am receving emails in my SAP Inbox.
    Please guide.
    thanks.

    Hi,
    You can only get the SAP mails into UWL notification tab with the Sonic connector (well of course with some custom development everything is possible).
    One trick to get the workflow for sending "mails" to UWL is to NOT use email sending step, but instead use a decision step in the workflow and send this work item to the user. The decision step can include the same message as the email, and have onl one option "Confirm" (or whatever). These you can easily display in UWL since they are normal work items.
    Regards,
    Karri

  • How to keep long text in bdc using create_text  function module

    hi,
    ihave bdc in that i having field like long text i have to upload the long text using create_text function module how to use and where to use in bdc. wat parameters i have to pass exactly.
    i need some other information like how can i pass this to BDC i got like this .
    can u plz check it.
    its a length of 255 chaters
    perform bdc_field using 'RSTXT-TXLINE(02)'
    'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
    & 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'.
    perform bdc_field using 'RSTXT-TXLINE(03)'
    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    & 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'.
    perform bdc_field using 'RSTXT-TXLINE(04)'
    'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
    & 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'.
    perform bdc_field using 'RSTXT-TXLINE(05)'
    'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh'
    & 'hhhhhhhhhhhhhhhhhhhhhh'.

    Hi,
    Use this coding where do u want,
    data: begin of textline occurs 10.
            include structure tline.
    data: end of textline.
    start-of-selection.
    textline-tdformat = '*'.
    textline-tdline = 'TESTING FOR CREATION OF TEXT'.
    append textline.
    clear textline.
        call function 'CREATE_TEXT'
             exporting
                  fid       = '0013'
                  flanguage = sy-langu
                  fname     = '0095000501'
                  fobject   = 'VBBK'
             tables
                  flines    = textline
             exceptions
                  no_init   = 01
                  no_save   = 02.
    end-of-selection.

  • 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

  • Error while using the function module..pack_handling_unit_dlvry

    Hi all...
    while using the function module pack_handling_unit_dlvry,
    we need to pass the handling unit number as per the functionality we require.
    but the mandatory field for the function module is the handling unit number in the form of bar code..
    so how to use this function module..
    All the useful answers will be regarded..
    Regards,
    Saroja.

    Have you tried using BAPI BAPI_HU_CREATE. Also view Function Module Documentation on its usage.

  • 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 can i use this  function module

    Hai
    How can i use this function module /SAPHT/SALES_ORDER_READ, already apply the some parameters in this function module, but it shows the error , please tell me, how to declare the parameters in this function module ,
    thanks
    neelima

    Hi
    For a particular sales order,you have to pass the order number and the item number in the sales order.
    It will display the rest of the values which u can capture them using internal tables.
    Regards,
    Vishwa.

  • URGENT ---- How to use BAPI_REQUIREMENT_CHANGE Function Module

    I want to change the Materail requirements through Txn MD62.
    Instead i am using BAPI_REQUIREMENTS_GETDETAILS Function Module.
    Using this I should use BAPI_REQUIREMENT_CHANGE Function Module.
    But the requirements are not getting changed.

    what kind of messages u are gettiing into the table RETURN ? u have to cross check this internal table .
    flow will be like this
    call  ' BAPI'
    if return[] is initial.
    commit work.
    else.
    do nothing.
    endif.
    Regards
    Peram

  • 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 BAPI_WARRANTYCLAIM_CHANGE2  function module

    i am unable to pass values to table  parameter.
    for above i have used WTY12_CLAIM_READ function module and i have give only cliam number as input and tried retriving other parameters(tables)
    from these i passed same table parameters to BAPI_WARRANTYCLAIM_CHANGE2  function module but unable to run it in se37.
    please just me any logic or solution to this.
    i am getting repeated error as :
    1)item types
    2)pricing
    3)partner
    if any one can send me a sample code to how to use these bapi .
    thanks,
    lokesh

    Hi Lokesh,
    I believe you are using the FM WTY12_CLAIM_READ_RFC to retrieve the claims related information by just passing Claim Number, and you are not getting any data back from the function module in the table parameters and you won't get any values as well, as there is no code in that function module.
    Thanks,
    Mahesh.

  • How to use BAPI_MATERIAL_AVAILABILITY Function Module....

    Hi Experts,
    I want to know actual free available quantity (ATP Qty.) for mass materials,
    How to use BAPI_MATERIAL_AVAILABILITY function module ?
    I have select all material from MARA and inserted in itab.
    LOOP AT ITAB.
    CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
      EXPORTING
        PLANT                    =
        MATERIAL                 =
        UNIT                     =
      CHECK_RULE               =
      STGE_LOC                 =
      BATCH                    =
      CUSTOMER                 =
      DOC_NUMBER               =
      ITM_NUMBER               =
      WBS_ELEM                 =
      STOCK_IND                =
      DEC_FOR_ROUNDING         =
      DEC_FOR_ROUNDING_X       =
      READ_ATP_LOCK            =
      READ_ATP_LOCK_X          =
    IMPORTING
      ENDLEADTME               =
      AV_QTY_PLT               =
      DIALOGFLAG               =
      RETURN                   =
      TABLES
        WMDVSX                   =
        WMDVEX                   =
    I dont know how to use it.
    pl. guide us.
    Yusuf

    Hi,
           data:  iwmdvsx type table of bapiwmdvs with header line,
           iwmdvex type table of bapiwmdve with header line.
    parameters: p_matnr type mara-matnr,
                p_werks type marc-werks,
                p_meins type mara-meins.
    call function 'BAPI_MATERIAL_AVAILABILITY'
      exporting
        plant            = p_werks
        material         = p_matnr
        unit             = p_meins
      CHECK_RULE       =
      STGE_LOC         =
      BATCH            =
      CUSTOMER         =
      DOC_NUMBER       =
      ITM_NUMBER       =
      WBS_ELEM         =
      STOCK_IND        =
    IMPORTING
      ENDLEADTME       =
      AV_QTY_PLT       =
      DIALOGFLAG       =
      RETURN           =
      tables
        wmdvsx           = iwmdvsx
        wmdvex           = iwmdvex.
    check sy-subrc = 0.
    Text
    ATP information
    Functionality
    Using this function module, you can determine the receipt quantity still available for a particular material in a certain plant according to ATP logic (MRPII).
    The availability check is carried out on transferring the material number, the plant and the input table (WMDVSX). The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule. In the function module, the system uses the checking rule defined in Sales & Distribution (A). You can overrule this checking rule by using an interface or a user-exit (exit_saplw61v_001). A similar procedure is also valid for the plant parameters. The customer number in the user-exit means that the plant selection can be controlled via the customer. If no plant parameters are given via the interface, the system uses the parameter 'WRK' saved in the user's fixed values.
    The results of the availability check are recorded in the output table (WMDVEX). This table contains dates and available receipt quantities (ATP quantities). The results of the check depends on the following entries:
    If no date and no quantity is transferred, the system displays the ATP situation from today's date into the future as the result.
    If only a date and no quantity is transferred, the system displays the ATP situation from the corresponding date as the result.
    If both a date and a quantity are transferred, the system calculates the availability situation for the quantity specified.
    In the last two cases, the parameter 'DIALOGFLAG' is supplied. This can result in the following:
    ' ' (blank)   <=> quantity completely available
    'X'           <=> only partial quantity available or not available at
                      all
    'N'           <=> Material not included in the availability check
                      (Material not relevant to the availability check)
    The system also displays the end of the replenishment lead time (ENDLEADTME).
    regards

Maybe you are looking for