cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Script- FM to get WBS element (PS_POSID) by using Int. Num.(PS_PSP_PNR)

0 Kudos

Hi Friends,

I am working on PO sapscript. I got value ekkn-ps_psp_pnr(Internal Number) by using ekko,ekpo into my subroutine. But now I need to print cobl-ps_posid (WBS element) value.

I heard that the both fields have inter-related. Please anybody give me the Function Module name which will use to get ps_posid value by using ps_psp_pnr.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You have two options here.

<b>1.</b> See this code. PRPS is master data table for WBS element. Here you get all wbs related information.

DATA: l_posid LIKE prps-posid.

SELECT SINGLE
             posid FROM prps
                   INTO l_posid
                   WHERE pspnr = ekkn-ps_psp_pnr.

<b>2.</b> Call this FM

CALL FUNCTION 'CONVERSION_EXIT_KONPR_OUTPUT'
     EXPORTING
          input  = ekkn-ps_psp_pnr
     IMPORTING
          output = l_posid.

Let me know if you need any other information.

Regards,

RS

Former Member
0 Kudos

Hi ,

Thanks for quick reply.

My problem was solved, I have used the FM

CALL FUNCTION 'PSPNUM_INTERN_TO_EXTERN_CONV'

EXPORTING

  • EDIT_IMP =

INT_NUM = g_ps_psp_pnr

IMPORTING

EXT_NUM = g_ps_posid

  • EXCEPTIONS

  • NOT_FOUND = 1

  • OTHERS = 2 .

Former Member
0 Kudos

hi,

exactly where to write routine? in the update rules or where exactly? please explain briefly about this? in bw CONVERSION_EXIT_KONPR_OUTPUT

FM does not exists.

please help me out asap.

regards

vadlamudi

Answers (2)

Answers (2)

0 Kudos

This has been resolved

raymond_giuseppi
Active Contributor
0 Kudos

Just use WRITE

WRITE ekkn-ps_psp_pnr TO cobl-ps_posid.

The table is PRPS where internal PSPNR and external POSID code are defined.

There is a conversion exit between PSPNR and POSID, so WRITE will convert PSPNR into POSID.

Regards

raymond_giuseppi
Active Contributor
0 Kudos

Look at OSS <a href="https://service.sap.com/sap/support/notes/522246">Note 522246 - PS consulting: Internal and external number for project/WBS</a>

instead of write you can call function module CONVERSION_EXIT_KONPR_OUTPUT.

Regards