Initials (Field PA0002-INITS) of the Partner ZI (Introducing Employee)

I need to write a routine, which need to get the Initials from the HR, by using pernr, and this should be apears on the Quotationsheet, behind the ZI Introducing Employee, so far I have written a Routine like following, since I am still a Amature, need kindly some help. thanks in Advance.
FORM GET_ZI_INITS TABLES
PARAMS STRUCTURE ITCSY.
RESULT STRUCTURE ITCSY.
DATA:
  VBELN LIKE VBDKR-VBELN,          
  INITS LIKE PA0002-INITS,
  AUDAT LIKE Document Nr. but from which Table?
read parameters
  READ TABLE PARAMS WITH KEY 'VBELN'.     
  MOVE PARAMS-value TO VBELN.
get personnel number of introducing employee (ZI)
  SELECT-SINGLE INITS FROM PA0002
    WHERE
      PERNR EQ pernr_zi and     " introducing employee number
      ENDDA GE AUDAT    and     " document date               BEGDA LE AUDAT.
  IF SY-SUBRC NE 0.
    " Not good                         <- what do we do if not good?
  ENDIF.
  IF SY-SUBRC = 0.
    VBELN = VBDKR-VBELN.               <- VBDKR-VBELN is not defined
  ENDIF.
get initials of personnel.
  READ pernr_zi WITH KEY NAME = 'PA0002-INITS'. MOVE pernr_zi  TO INITS.
  ... <- please add this part
  READ TABLE RESULT WITH KEY 'ZI_INITS'.
  IF SY-SUBRC = 0.
    WRITE ZI_INITS TO RESULT-VALUE.
    MODIFY RESULT INDEX SY-TABIX.
  ENDIF.
ENDFORM.                               "get_ZI_INITS

Hi sean,
1. I understood your requirement.
2. This is the rectified code.
REPORT abc.
*&      Form  GET_ZI_INITS
      text
     -->PARAMS     text
     -->RESULT     text
FORM get_zi_inits TABLES
params STRUCTURE itcsy
result STRUCTURE itcsy.
  DATA:
  vbeln LIKE vbdkr-vbeln,
  inits LIKE pa0002-inits,
  audat LIKE sy-datum.
*------- Data for introducing pernr
  DATA :  pernr LIKE p0001-pernr.
read parameters
  READ TABLE params WITH KEY 'VBELN'.
  MOVE params-value TO vbeln.
Read PERNR
  READ TABLE params WITH KEY 'PERNR_ZI'.
  MOVE params-value TO pernr.
get personnel number of introducing employee (ZI)
  SELECT SINGLE inits FROM pa0002
  INTO inits
  WHERE
  pernr EQ pernr AND " introducing employee number
  endda >= sy-datum AND begda <= sy-datum.
Output Values
  READ TABLE result WITH KEY 'ZI_INITS'.
  IF sy-subrc = 0.
    WRITE inits TO result-value.
    MODIFY result INDEX sy-tabix.
  ENDIF.
ENDFORM. "get_ZI_INITS
regards,
amit m.

Similar Messages

  • Get PA0002-INITS by using Partner (ZI Introducing Employee)

    Hello everyone, need to write a routine as follows,
    in oder to get the reimbursement for the person who related to this quotation. and the initials should be appears on the quotation sheet, using the ZI introducing employee I can fetch the personnel Nr, and then through HR table PA0002 to get the intials.
    Document Nr      table    VBPA
                     field    VBELN 
          table   -
    >field PARVW  (ZI)
    Personnel Nr. -
    >field  PERNR
    HR             table    PA0002
                   field    PERNR
                   field    INITS
    so far I am doing in this step, there might be some errors in this report.who can help me to finish this report?
    Routine: GET_ZI_INITS USING VBELN (DOCNR) CHANGING INITS
    DATA:
          vbeln LIKE vbak-vbeln,
          inits LIKE pa0002-inits,
    read params
    READ TABLE PARAMS WITH KEY 'VBELN'.
    MOVE PARAMS-value TO VBELN.
    VBELN (doc nr)
    get pernr_zi (introducing employee number) from document header
    SELECT-SINGLE PERNR FROM VBPA
          WHERE
               PARVW = ZI
    IF SY-SUBRC NE 0.     " ZI exists?               
    ENDIF.
    get initials
    SELECT-SINGLE INITS FROM PA0002
         WHERE
              PERNR EQ pernr_zi and     " introducing employee number
              ENDDA GE AUDAT    and     " document date
              BEGDA LE AUDAT.
    IF SY-SUBRC NE 0.
         " what we can do if it is Not good,
              I am think of to get the first alphabet of the first name and last name from HR
    ENDIF.
    return params
    INITS (initials)
    thank you very much for ur help!

    Hi Sean,
    I do not see anything wrong with your approach.. Did you get any errors in the actual code? Pl take a look at the following piece to retriev info from PA0002.
    data: w_inits type inits,
          w_nachn type nachn,
          w_vorna type vorna.
    select nachn vorna inits into (w_nachn,w_vorna,w_inits)
                              up to 1 rows
                              from pa0002
                              where pernr = '00000124' "introducing employee number
                                and begda le sy-datum  "document date
                                and endda ge sy-datum.
    endselect.
    if sy-subrc ne 0.
    * infotype 0002 record does not exist.. PERNR number may be wrong
    else.
      if w_inits is initial.
        concatenate w_vorna(1) w_nachn(1) into w_inits.
      endif.
    endif.
    Regards,
    Suresh Datti

  • Is there any user exit/ badi to populate the partner bank type for   F-63.

    Is there any user exit/ badi to populate the partner bank type (field name BSEG-BVTYP) in transaction F-63. There is exit ‘ZFI_FOAP_CDITEMS_00001011’ having BKPF and BSEG as only import parameters so I can’t change the value for BSEG-BVTYP.
    So could you please let me know any exit where I can change the value for BSEG-BVTYP for transaction F-63?
    Thanks in Advance,
    Steevan

    hi,
    Below r the user exit related to transaction  F-63.
    Check out if any of them will solve ur Query..
    F050S001            FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002            FIDCC1: Change IDoc/do not send
    F050S003            FIDCC2: Change IDoc/do not send
    F050S004            FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S005            FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S006            FI Outgoing IDoc: Reset Clearing in FI Document
    F050S007            FIDCCH Outbound: Influence on IDoc for Document Change
    F180A001            Balance Sheet Adjustment
    FARC0002            Additional Checks for Archiving MM Vendor Master Data
    FEDI0001            Function Exits for EDI in FI
    RFAVIS01            Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00            Line item display: Checking of selection conditions
    RFKORIEX            Automatic correspondence
    SAPLF051            Workflow for FI (pre-capture, release for payment)
    Reward points if helpful,
    Regards,
    Brijesh

  • BAPI_PO_CREATE1 is not defaulting all the partner role in the PO

    Hi All,
    I am facing a problem while Purchase Uploads using  BAPI_PO_CREATE1 in the LSMW via Idoc .
    The BAPI is not behaving same as Txn ME21n .
    In the Txn ME21n when we enter the Vendor the partner tab is automatically filled with  all the  Partner roles .
    While when we use BAPI it is only filing the Partner role with a single partner  role VN.
    We are sending the sturcture partner role  as blank because we wanted it to be defaulted as it is in Txn ME21N.
    During the program analysis we found the following :
    BAPI is calling the Function Module MM_PARTNER_SELECT which try to fill the Partner function
    using WYT3 table . The table  Wyt3 has the plant field as empty for that particular Vendor.
    The BAPI is  using the plant to determine the partner roles .
    While in Txn ME21n the plant field is not used for determining the partner role .
    In txn Me21n once we change the vendor entered initially & then again re enter the  initial vendor  number
    then it behaves like BAPI & only display the single partner role .
    Kindly advice .
    Regards,
    Anurag Goel

    Hi All ,
    FYI
    We found the solution for  defaulting  partner role using   BAPI_PO_CREATE1,It is a customization issue .
    We have check the  Higher level indicator ( Search at higher level )  in the customization Txn OLME  Under Partner Determination -
    > Partner setting in Purchasing document -
    >Define partner schemas
    If this indicator is not set, the system only  transfer partner roles  that are maintained at plant level .
    Best regards,
    Anurag Goel .

  • Uploading the partner function for the business partner

    Hi Experts ,
    I wish to upalod the partner function fields like
    partner function
    sales area
    division
    channel etc .
    Can anyone suggest me how to uaplod this via a BAPI in ECC system ?
    regards
    Abhi.

    HI ,
    Pls check Kindly check
    BAPI_CUSTOMER_CREATEFROMDATA1
    regards,
    PD

  • How to get the Partner Function of the corresponding index

    Hi experts,
    We have a requirement where in we need to fetch the corresponding partner function(PARTNER_FCT value) , when we click on the value help icon of a Partner_No_descr field of the component BTPARTNER.
    For eg:- When we click on the value help icon of second entry in the assignment block 'parties involved',
    we should fetch the Partner Function (PARTNER_FCT)value of the second entry.
    We tried using the GET_CURRENT ( ) ,GET_BY_INDEX ( ) etc method , but to no avail.
    Any helpful pointers would be rewarded.
    Kindly help.

    This thread remains closed.

  • Howto check the Partner function

    Hi all,
    My requirement is to get partner (like sales employee in VA41) from the user.
    I need to check the value given bythe user whether it is correct or wrong.how to achive this.

    Hi ,
    u need to validate the sales employee number or name ...
    for ur query u need to look for the specified field as a primary key in a given table ..
    what is the user giving the partner number/customer number or name ..
    1.
    if its partner u can validate it from the VBPA entries ..
    vbpa-parvw ,
    vbpa-kunnr,
    vbpa-parnr,
    2.
    if its a name u need to capture the parnr number ..then the table will be
    KNVK
    KNVK-PARNR  PRIMARY KEY
    KNVK-KUNNR
    this is other way around ..
    3.
    if its a customer number
    validate it from table KNA1
    KNA1-KUNNR.
    hope this helps regards,
    VIjay.

  • How to customize the layout of the partner selection pop-up in sales docs?

    When entering a sales order and mulitiple payers, for instance, are defined for the sold-to, a pop-up window will display allowing you to select the correct payer.  I've been told the layout of that screen can be changed and saved as a global default layout.
    If so, how is that done without ABAP coding?  I've tried all the right-click options I can find in that pop-up window. I can change the layout for the moment, but find no option to save it as a permanent display layout.
    Thank you,
    Jay K.

    Alan,
    We just wanted to change the order of the fields displayed after the partner number to view fields that are more relevant to how we identify our Payer partners.  Specifically, near the end is a field consisting of the partner name, address, city and state condensed into 1 field. We'd like to see that one right after the partner number.
    I'm beginning to think you are correct, the only method is an ABAP mod.  Yet, when you right click on that pop-up, there is an option to access the current layout and another to choose a layout.  That seems to imply you can create a custom layout and save it.  But if that's true, I haven't been able to figure out how.
    Thanks,
    Jay

  • Can the partner master data ( name, text ) be used in a Query

    Hi,
      I have a requirement to have query against CRM cubes/ods, which can query data by Partner address   or text (Short description, Medium description or Long description).
      For example, the cube has a characteristic 0CRM_SOLDTO ( Sold to party ) and we can always write a query which will have this field as a variable in the selection field and then query the appropriate data. But can we also query the data as per the partner name or short description or address( say zip code ? ).
      If yes can you please let me know how. For example consider the following simple example cube which has a characteristics as Customers( say 1000001... and the characteristics "customer" has master and text data ( short text say "company x".
      How to write a query against the cube which will take the customer text as input field and display the relevant data.
      Thanks
    Arunava

    Hi
    I am even not aware of a standard function to do it. But one more option I can think of. But this only applicable with simple reports & with restricted kef figures.
    1. You create a dummy sold-to-party (S2)
    2. Add it to the same or different dimension as that of origional sold-to-party (S1) in the cube.
    3. Create a structe in the report for your KFs or RKFs.
    4. Create one RKF with S2 and with some key figure like "no of records". Create a variable V2 on S2 (user entry) and include this in the RKF. Hide this RKF. (So, basically you use this RKF to invoke the variable V2 to accept the Text of sold to party when the report is executed).
    5. Include the required KFs (or RKFs with S1) in the structure. Create a customer exit varaible V1 (Not ready for input) on S1. In this exit, determine the Sold to Party ID from the Text entered in V1 & the text table of sold to party.
    Basically, what ever we do in update rules (as suggested earlier), now we do it in a customer exit. hope this helps.
    regards,
    atlaj

  • Restricting the partner address change in both VA01 & VA02

    Hi All,
    In Sales Order Creation / Change i need to make the partner address fields editable but want a restriction on save.
    For that i am doing the following:
    Change:
    This is possible by restricting the update comparing YVBPA & XVBPA table using parameter UPDKZ.
    Create:
    In the create scenario YVBPA table remains empty.Are there any other tables I should look at to restrict this address data change?
    However, there is a table XVBADR , changes to which do not influence the final display address.
    Alternatively , do we have an alternative approach to restrict the partner address change in both VA01 & VA02?
    Thanks in advance!!!
    Regards,
    AP

    Resolved by using YVBPA & XVBPA tables.

  • Cannot find the partner with BAPI_SALESORDER_CHANGE when I use alphanumeric

    I try to use the BAPI_SALESORDER_CHANGE to create a sales order, however the BAPI fill with zero at the beginning of the ID partner.
    For example If I had the ID partner 123456 when I use the BAPI_SALESORDER_CHANGE, the BAPI automatically filled 4 zeros at the beginning of the number = 0000123456 with this number the BAPI can find the ID partner in the SAP Tables.
    However,
    If I had the ID partner IC4100 when I try to use the BAPI_SALESORDER_CHANGE, the BAPI automatically filled 4 zeros at the beginning of the ID = 0000IC4100 with this number the BAPI canu2019t find the ID partner in the SAP tables.
    Could anybody help me please?  How can I use an alphanumeric ID for the partner function?
    Thanks,
    Adriana

    Hi,
    I think in this case use the Conversion Alpha exit for this Partner. CONVERSION_EXIT_ALPHA_INPUT try to pass the fields of type KUNNR.
    Let me know if any.
    Regards,
    Srinivas

  • I want to define the partner link to be an XML file

    Another process creates an XML file and dumps it inot a directory. I want to use the file adapter to consume it. I can not figure out a way to use the file adpater for an XML file. I have used it for csv and serveral other non-standard formats but the file adapter doesn ot seem geared toward XML files. So I figure I must need a WSDL file to create the partner link with. How can I create a wsdl file from sample xml files?

    Hello rsuchoza,
    What you really are looking for is an XML Schema (.xsd file), to use in the Schema Location field.
    If you have another BPEL process creating this XML file, you can probably find the an XSD that fits your XML in that project?
    <rune/>

  • User exit to change the partner function in VA02

    Hi experts,
    I have a requirement to increment Volume field value everytime when the end customer ( partner function) is modified  at header and item level.
    Can you suggest some exits ?
    PLease suggest

    Hi
    Try with the following exits.
    EXIT_SAPLV46H_002
    EXIT_SAPLV46H_001
    Thank you,
    Sekhar.

  • No INBOX Selection for the Partner

    Hi Experts,
    Could someone please tell me where we can configure a Vendor for "No INBOX Selection for the Partner".
    Is this at some transaction level or in the Shopping cart.
    We have this field in the table CRMD_PARTNER,  Field - DISABLED
    Due to this the Vendor gets dropped and the PO goes into HELD status.
    We have implemented the Preferred to FIxed Vendor and works perfectly, except for these partners with CRMD_PARTNER-DISABLED = 'X'.
    Thank you.

    thanks

  • BADI triggered in the partner & competetor tab of oppetunity & quote.

    Hi,
    Please let me know
    1. which BADI will be triggerd when we choose partner function in the parner/competer tab of quotation and opertunity.
    2. BADI triggered in the same tabs when we press enter in the partner field.
    I am using CRM_ORDERADM_H_BADI for Usage check in quotation. But it is not triggered when we change the partner function/ partner in the partner tab of quotation.
    I am using CRM_OPPORT_H_BADI for Usage check in oppertunity but it is not triggered when we change the partner function/ partner in the partner/competitor tab of opertunity.
    Please give input what BADIs need to be used.
    Thanks and in advance.
    Regds
    Harish
    Thanks and Regards
    Harish

    Hi Harish,
       Look at CRMV_EVENT transaction and assign the function module with your code in the event of partners.
    Regards.
    Manuel

Maybe you are looking for

  • Windows Vista- Update Error 80044016

    Good afternoon! Friend of mine is struggling with Windows Vista SP 2 - Windows Update. So far I tried to: -Disable AV, Disable Firewall -Clean boot -Automated solution - fix it -Sfc -checksur -re-register responsible dll's regsvr32 wuapi.dll regsvr32

  • No connection between my iPhone and printer

    I have a I-phone4 and have just brought a hp photosmart print but the phone cannot par with the printer it is saying the phone has no aorprint

  • New iTunes Library doesn't see .aif file

    I gathered my music into one new library on a new external HD but it didn't gather in the .aif file I made as an audio track for a movie. I can see it and click on it but it comes up with a QuickTime player window. If I play it, the track plays but d

  • I am facing some problems with managing the local storage of my iPad !!

    SO i wanted to download asphalt 7 on my iPad 16gb with 1.9gb left ! And the size of the game is 1.27gb but when i tried to install it, a message appeared saying that THERE IS NOT ENOUGH LOCAL STORAGE TO DOWNLOAD ASPHALT 7 HEAT !!  so i went to Settin

  • Duplicate invoices USA

    Hi all, I have the following situation: an invoice issued in USA was posted with FB60 in SAP, using reference field for the invoice number. A correction was made to this invoice and the vendor send it back with the same invoice number but the correct