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

Understanding the Source Code

Former Member
0 Likes
1,675

Hi All,

Pasted below is the Source Code of a Conversion Routine(CONVERSION_EXIT_ABPSP_INPUT).Can anyone tell me the fnctionality of this code.

Thanks

Sajan.M

if flg_exists_abpsp = '?'.

call function 'FUNCTION_EXISTS'

exporting

funcname = 'CONVERSION_EXIT_KONPR_INPUT'

exceptions

function_not_exist = 1.

if sy-subrc <> 0.

clear flg_exists_abpsp.

else.

flg_exists_abpsp = 'X'.

endif.

endif.

check flg_exists_abpsp = 'X'.

call function 'CONVERSION_EXIT_KONPR_INPUT'

exporting

input = input

importing

output = output

exceptions

not_found = 1.

if not sy-subrc is initial.

MESSAGE E021(ABPS) WITH INPUT RAISING NOT_FOUND.

endif.

endfunction.

8 REPLIES 8
Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,296

Hi!

This function calls the conversion exit CONVERSION_EXIT_KONPR_INPUT - in case this exit exists.

Regards,

Christian

Read only

Former Member
0 Likes
1,296

Hi Sajan,

This piece of code is,

first, checking if there exists a FM 'CONVERSION_EXIT_KONPR_INPUT'.

After ensuring this FM is existing,

It is calling the FM 'CONVERSION_EXIT_KONPR_INPUT' to convert KONPR into internal form.

Regards,

Raj

Read only

0 Likes
1,296

Hi Raj!!

I don't know if you can help me wiht that

I need use the FM CONVERSION_EXIT_ABPSP_OUTPUT, but in my BW (version 3.1) not exist the FM CONVERSION_EXIT_KONPR_OUTPUT.

Do you know can I do?

Thank.

Read only

sreekanthgo
Contributor
0 Likes
1,296

Hi Sajan,

Your Code flow will be something like this...

1) It checks whether the Flag flg_exists_abpsp = '?', If it is true..

2) It executes the FM FUNCTION_EXISTS and checks whether the FM 'CONVERSION_EXIT_KONPR_INPUT' is exists in your repository or not?

3) If it exists, then the Flag flg_exists_abpsp = 'X' and it will executes the same conversion routine.

Thanks,

Sreekanth G

Read only

0 Likes
1,296

Hi,

Thanks for the inputs.

This is one other code that its drilling down into, i.e the "CONVERSION_EXIT_KONPR_INPUT" program.

Will be helpful if you can let me know if you can let me know the pseudo code to understand the functionality.

Sajan.M

FUNCTION CONVERSION_EXIT_KONPR_INPUT.

*"----

-


*"Lokale Schnittstelle:

*" IMPORTING

*" INPUT

*" EXPORTING

*" OUTPUT

*" PRPSWA LIKE PRPS STRUCTURE PRPS

*" EXCEPTIONS

*" NOT_FOUND

*"----

-


DATA: CON_NULL(1) VALUE '0'.

DATA: INIT_POSID LIKE PRPS-POSID VALUE '00000000 '.

DATA LOC_POSID LIKE PRPS-POSID. "P30K050296

CHECK NOT INPUT IS INITIAL.

  • Dummy-Nummer für nicht gefundene int. Nummer? "P30K050296

IF NOT PRPS_BUF_NOTEXIST-OBJ-PSPNR IS INITIAL.

READ TABLE PRPS_BUF_NOTEXIST WITH KEY INPUT BINARY SEARCH.

IF PRPS_BUF_NOTEXIST = INPUT.

OUTPUT = PRPS_BUF_NOTEXIST-OBJ-PSPNR.

CLEAR PRPSWA.

EXIT. "Function

ENDIF.

ENDIF.

*.konvertiere externe nummer in uneditierte form.......................

CLEAR GET_BUF.

CLEAR PRPS_BUF.

CALL FUNCTION 'CJPN_PROJEKTNUMMER_UNEDIT'

EXPORTING

INPUT = INPUT

IMPORTING

OUTPUT = GET_BUF-POSID.

  • if get_buf-posid eq init_anz or

  • get_buf-posid is initial or

  • get_buf-posid eq init_posid.

  • clear prps.

  • output = get_buf-posid.

  • exit.

  • endif.

CLEAR PRPS.

PERFORM FILL_PRPS_BUFFER USING SPACE SPACE.

IF PRPS_BUF IS INITIAL.

*.vielleicht handelt es sich um eine Vorläufige PSPnummer?

MESSAGE E021 WITH INPUT RAISING NOT_FOUND.

  • RAISING NOT_FOUND.

ENDIF.

OUTPUT = PRPS-PSPNR.

MOVE PRPS TO PRPSWA.

ENDFUNCTION.

Read only

Former Member
0 Likes
1,296

actually

it is checking for flg_exists_abpsp = '?'

if it so then

it is calling the FM

CONVERSION_EXIT_KONPR_INPUT

and getting the exception as 1 it function does not exisits

if that function exists

it is clearing the flag and coming out of the code

else

setting the flg_exists_abpsp to 'X'

endif

then after checking whether it is X or not .

if it is X then only it is calling the FM

CONVERSION_EXIT_KONPR_INPUT

with parameters

What I can understand from this is

if flg_exists_abpsp = '?'

then FM is going to be checked whether it is existing or not

Read only

0 Likes
1,296

Could u tell me what the functionality of the FM that is being called inside this program.

Read only

0 Likes
1,296

This FM converts the internal code for a WBS element

into the external code.

The input is always a numeric value (8 chars) and output is the WBS code that you see for instance in CJ03 (master data display). Exact coding depends on mask (tcode OPSJ), but can be for example like: A.AAA.1022999

Kind regards,

Pascal Roemaat