Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Service PR validation

Former Member
0 Likes
3,945

Hello Folks,

                    Hope you all are in pink of your health! Well I am doing some validation in ME51n i.e. Service PR validation where I want the data of the Service item level data with their WBS element and quantity . I am using BADI me_process_req_cust .

PS: Sorry if this is wrong section to ask.

Hello Folks,

                    Hope you all are in pink of your health! Well I am doing some validation in ME51n i.e. Service PR validation where I want the data of the Service item level data with their WBS element and quantity . I am using BADI me_process_req_cust .

PS: Sorry if this is wrong section to ask.

15 REPLIES 15
Read only

Former Member
0 Likes
3,687

Hi ALex,

  What is your query ? Do you want to know about BADI  or you need validation logic ?

BR,

Prakash

Read only

0 Likes
3,687

My query is I want to have the data of the item level with their respective WBS element in the BADI . I have tried several methods too but, unable to find the combination where can I get the WBS element and it's service quantity for each line item.

Validation logic I have already built but unable to fetch the required data.

Read only

0 Likes
3,687

Hi Alex,

Pass the value of  PS_PSP_PNR in table EBKN (EBKN-PS_PSP_PNR) in field OBJNR of table PRPS (PRPS-OBJNR) with a * in the begining.

Say you find value 00000420 in EBKN-PS_PSP_PNR, then pass value *00000420 in PRPS-OBJNR.

In field PRPS-PSPNR, you will get the WBS number.

Hope this helps.

Regards,

Naveen

Read only

0 Likes
3,687

Hi Naveen,

               Can you relate this logic in while creating service PR in me51n for BADI me_process_req_cust I mean for given WBS element how may I get the given service quantity for the same line item ?
for e.g. In process_item method of the given BADI I am only able to fetch only first WBS element for the all the service item . So I need to get all the WBS element and their respective quantity by using loop or anything .

Read only

0 Likes
3,687

Hi Alex,

Loop at EBKN for BANFN and BNFPO

Then in loop fetch from PRPS as PRPS-OBJNR = EBKN-PS_PSP_PNR there in structure PRPS you can find the user defined quantities.

Hope this helps.

Regards,

Naveen

Read only

0 Likes
3,687

Thanks Naveen for your prompt reply.Your functional guide is indeed helpful but,Here I am looking for more into the technical guide like which object and which method to be use of BADI to retrieve such information.

Read only

0 Likes
3,687

Hi -

Please check following

BADI - ME_PROCESS_REQ_CUST

Method - PROCESS_ITEM

In this method, put the below code to check WBS element

DATA :   lv_pspnr TYPE ps_posnr. "WBS Element

   CALL METHOD im_item->if_acct_container_mm~get_data
          IMPORTING
            ex_ps_psp_pnr = lv_pspnr.

Let us know, if it helps.

Read only

0 Likes
3,687

Well Atul it is only returning the account assignment tab data ,While I am looking for the data of the service item data .I am attaching the screenshot of the item level tab of T-code ME51n for the same.

The code which you've given is returning the data of the account assignment,Whereas I want the data of the services tab which I've highlighted in my screenshot.

Read only

0 Likes
3,687

Hi Alex -

Actually I do not have the system to check the ME51N. I will give two more hints below, please check both of them.

1.  DATA :   li_items TYPE mmpur_accounting_list,
             lw_items TYPE mmpur_accounting_type,
             lw_exkn  TYPE exkn.


   IF im_item IS NOT INITIAL.


   CALL METHOD im_item->if_acct_container_mm~get_items
      RECEIVING
        re_items = li_items.


IF NOT LI_ITEMS is initial.


    LOOP AT li_items INTO lw_items.
      CALL METHOD lw_items-model->get_exkn
        RECEIVING
          re_exkn = lw_exkn.


* Check the value of WBS with lw-exkn-PS_PSP_PNR to validate it


    ENDLOOP.

ENDIF.

   ENDIF.

                                

2. DATA :   LW_ITEM      TYPE MEREQ_ITEM,
   IF im_item IS NOT INITIAL.

                CALL METHOD  im_item->GET_DATA
                  RECEIVING
                    RE_DATA = LW_ITEM    .

* Now check LW_ITEM-PACKNO

if LW_ITEM_PACKNO is not initial.

Then select PS_PSP_PNR from table ESKN when PACKNO = LW_ITEM-PACKNO .

HERE PS_PSP_PNR is the WBS.

Let us know, if it helps.

Read only

0 Likes
3,687

Unfortunately neither of them solved my purpose as first one gives the WBS element of the account assignment not the one with service quantity because there are the chances of having multiple WBS element from service item data.

In second case also it is not returning any accurate Result , As my requirement is to get the data of service item it also looks like that this BADI won't help much I should rather try for the Exits now..

I am able to find out this "MEREQ001" exit will it help in getting service related data ?

Read only

0 Likes
3,687

Dear Alex -

You wrote '

Unfortunately neither of them solved my purpose as first one gives the WBS element of the account assignment not the one with service quantity because there are the chances of having multiple WBS element from service item data'

If you have multiple service line, then you will have multiple 'li_items' for service line per line item of PR.

I wrote '

LOOP AT li_items INTO lw_items.

      CALL METHOD lw_items-model->get_exkn

        RECEIVING

          re_exkn = lw_exkn.

* Check the value of WBS with lw-exkn-PS_PSP_PNR to validate it

    ENDLOOP.

When you loop as mentioned you will get all the WBS element of the service items.

Please check the fields lw-exkn-PS_PSP_PNR (internal) and lw-exkn-PSP_PNR (external) both as per your need.

I have checked in my system. I am getting all service WBS . Please check once again.

Read only

0 Likes
3,687

Well Atul certainly it solved my half of the problem as I am able to get all the WBS element in the given line items But , still am not able to get the quantity added in that line item .Also one thing I noticed during debugging of the same that if in line item if I have added same WBS element then I will be only getting the it only once whereas it's price get's collected in lw_exkn-NETWR .
E.G.

if I have entry as follows ,

quantity                    PRICE                 WBS ELEMENT
10                            20                             12

20                            10                              12

30                             10                              14

10                             10                               14

then lw_items will get data of 2 line item combining the WBS element

and in structure I will get the data in lw_exkn as below,
for first loop pass
lw_exkn-psp_pnr = 12
lw_exkn-netwr = 400  ( 10 quantity of 20 price & 20 quantity of 10 price)

on second loop pass
lw_exkn-psp_pnr = 14
lw_exkn-netwr = 400 ( 30 quantity of 10 price & 10 quantity of 10 price)

so is there anyway that I can also get the Quantity as well ?
If you have any doubt please let me know in above scenario.

Read only

0 Likes
3,687

Hi Atul,

               I haven't got any work around for the same problem.And Time is running out so I have decided to put implicit enhancement still am not able to get the place where I can find the service item data in implicit also.If you could put more light on this thing that would be really grateful of you.Looking forward to your quicker reply on this.

Read only

Former Member
0 Likes
3,687

Hello Abapers ,

                          As this is getting bit delayed please help me out if you can for further reference see above communications.. !
Looking forward to hear from you..

Read only

Former Member
0 Likes
3,687

@All

       I am not able to get my required data hence I am declaring it as assumed answer.

For those in future who are having such similar requirement may also try following things which might be useful for you,

Function Exit EXIT_SAPLMLSP_030

It is returning some Service Related data.

For the implicit enhancement you may put break-point at SAPLMLSP and screen number is 400.