cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Automatically populate Person Responsible in IW32/33 screen

kavmp49
Participant
0 Kudos
949

I want to auto populate person responsible field in IW33. The service order of certain order type and PM activity type is created through a custom transaction (using BAPI_ALM_ORDER_MAINTAIN).

I tried using pers_no in wtbl_oper table for the BAPI in the custom program but that did not reflect in IW33 screen. So I am thinking of using enhancements for order creation at save which will let me update the pernr field in afvgd structure for the ordertype-activitytype combination

Any other suggestions are welcome as well. Thanks!

 

Accepted Solutions (1)

Accepted Solutions (1)

RaymondGiuseppi
Active Contributor
0 Kudos

From your screenshot the displayed field seems to be a partner defined at header of order header

  • Can you check field name (F1/tech.opt) and your order type Customizing
  • Look at parameter(s) IT_PARTNER(_UP)
kavmp49
Participant
0 Kudos
Hi I checked the F1 help and it says the field is PERNR from PMPARTNER structure. I found the field in IT_OPERATION fieldname- PERS_NO but when i assign a value to the field call the BAPI, it is not reflecting in IW33.
RaymondGiuseppi
Active Contributor
0 Kudos

Ok, this is an order partner, partners can be many entities: customers, suppliers, employees, etc.

  • So I guess you've found another employee field, but irrelevant as it's not at the correct level
  • Browse the IHPA table “Maintenance: Partners” for an existing order to find the partner function (beware, there's a conversion exit on this field)
  • or (better) run BAPI_ALM_ORDER_GET_DETAIL on this PM order.
kavmp49
Participant
0 Kudos
Okay, got it. In this case the person number PERS_NO field corresponds to person responsible and through debug mode I could find that the value is getting populated by reading infotypes. Now this concept seems totally alien to me. Moreover I am not able to find out which table this field value is stored in. This is standard sap code and field, so can you help me out pls?
RaymondGiuseppi
Active Contributor
0 Kudos

Field would be IHPA-PARNR

  • Look at FM such as PM_GET_PARTNER_INFO or FM of group IPAR ,such as PM_PARTNER_READ or PM_PARTNER_READ_MASTER_DATA
  • Some documentation is available online
  • Some blog on PM tables
kavmp49
Participant
0 Kudos

Hi, thanks for your insight, If I might add one more thing about the field, It doesn't seem to be a partner number like char12, the field in concern has char 8 like in PMPARTNER structure PERNR field. And the values are like 0000580, 00007843 etc. So, I think this table and FMs won't be the right fit

RaymondGiuseppi
Active Contributor

The employee number is 8 characters long, but other partners such as suppliers or customers are 12 characters long. Have you had a chance to browse the IHPA table or test some of the provided FM?

The field you identified seems to be this one, at operation level

raymond_giuseppi_0-1727342783937.png

Start by testing BAPI_ALM_ORDER_GET_DETAIL on an existing order on which the employee number appears. Explore the returned data to find this personnel number.

kavmp49
Participant
0 Kudos
Hi, Yes. Couldn't find any leads in IHPA table. Otherwise, BAPI_ALM_ORDER_MAINTAIN (which is used in my custom prog to create this order) is having a few FMs to check for the existence of the Person in the system. But none to update as such. So I was wondering if we can pass the value XXXXXXXX to the person number to the order while creation itself
RaymondGiuseppi
Active Contributor
0 Kudos

The logic that displays this field (a subscreen in a subscreen) looks like 

 

* Anlagezustand Text ermitteln
 FIELD CAUFVD-ANLZU MODULE ANLZU_CHECK_PBO.
 CALL SUBSCREEN PARTNER  INCLUDING Y_PARTNER_PROGRAM " <--- here
                                   Y_SUB_DYNPRO_PARTNER.
 CALL SUBSCREEN SUB_PM_ADDR INCLUDING YSAPLCOIH PM_ADDR.

 

Values come from Customizing (a partner type)

 

      SELECT SINGLE * FROM TPAR INTO LS_TPAR
      WHERE PARVW = T350-PARVW_VERA.

      IF LS_TPAR-NRART = 'PE'.
                                       "/ screen from saplcoih.
        Y_PARTNER_PROGRAM    = YSAPLCOIH.
        Y_SUB_DYNPRO_PARTNER = Y_SUB_DYNPRO_PARTNER_COIH.

      ELSE.
                                       "/ screen from SAPLIPAR
        Y_PARTNER_PROGRAM    = YSAPLIPAR.
        Y_SUB_DYNPRO_PARTNER = Y_SUB_DYNPRO_PARTNER_KOPF.

      ENDIF.

 

NB: 'PE' means that the partner is an employee

In the MASS change transaction for PM ordres, there is a mapping that link also to partner

Class CL_IWO_MASS_CHANGE_STANDARD2 method GET_HEADER_MAPPING

    et_mapping_table = VALUE #( ( structure = 'BAPI_ALM_ORDER_HEADERS_I'          bapi_fieldname = 'ORDPLANID'                    internal_fieldname = 'MAINTENANCEORDERPLANNINGCODE' )
" ...
                                ( structure = 'BAPI_ALM_ORDER_PARTN_MUL'          bapi_fieldname = 'RESPONSIBLEUSER'              internal_fieldname = 'RESPONSIBLEUSER'               )
" ...

Try to debug on your system.

kavmp49
Participant
0 Kudos
Hi, thanks for all your input. I followed your advice and was able to update the person responsible in the partners internal table for the BAPI

Answers (0)