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

Function Module

Former Member
0 Likes
1,213

Friends,

Please help me in resolving the below issue.

I wanted to create a new profile by copying the existing profile in SPRO Transaction. To acheive the same I performed a recording and then I created a function module based on the recording.

When I execute the function module I am facing the below issues

1) The profile is not copied - meaning I am unable to see new profile in SPRO

2) The sy-subrc has a value called 1.000, what does this value mean.

3) Once after the execution of the function module I get the message tab filled, how to analyse the messages in the message tab

4) In my recording I could see a BDC_OKCODE with a value =%_GC 126 35. What does this mean?

5) I wanted to know the set of BDC_OKCODE values-Where can I get it from.

Thanks in Advance for your replies.

Regards,

Usha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,039

Hi,

Normally one can't use the SPRO for BDC postings. We need to get the actual transaction code which will be used for posting of the data. As mentioned, SPRO>CRM>so..on, u will get to a screen wherein actually the data is been populated. At this point just check the tcode which is been used by SAP and from here do the BDC recording and use the same. Use the transaction code in the call transaction.

9 REPLIES 9
Read only

Former Member
0 Likes
1,039

Hi Usha,

>>2) The sy-subrc has a value called 1.000, what does this value mean.

This means the call transaction failed in your FM.

>>3) Once after the execution of the function module I get the message tab filled, how to analyse the messages in the message tab

Pass these mssages variables to the FM FORMAT_MESSAGE to see what those messages actually mean.

>>4) In my recording I could see a BDC_OKCODE with a value =%_GC 126 35. What does this mean?

OKcodes are the functin codes that are attached to user actions(Like pressing buttons etc.)

One button-one ok_code.

You can see all the OK_Codes in a screen(For which you have done the recording) by going to the transaction se51 and see the element list.

Regards,

ravi

Read only

Former Member
0 Likes
1,039

Hi Usha,

Can you paste the recording and your code.

BTW, run the transaction thru 'A' mode- All screens mode, you might findout why its failing.

Regards,

Raj

Read only

Former Member
0 Likes
1,039

Hi Ravi,

Your answer was very much helpful.

When I formatted the message I get the information below

"No batch input data for screen SAPLSHI01 0200".

I just like to jot down the steps of my recording.

1. I went to the transaction SPRO.

2. Then I choose the tree node CRM

3. Then I choose IC Web Clients and so on

When I tried executing the session in foreground, the sequences are as follows

1. It reaches the transaction SPRO but it does not choose the tree node CRM.

can you help me resolve the problem?

Read only

Former Member
0 Likes
1,039

Below is my code

subrc = 0.

perform bdc_nodata using NODATA.

perform open_group using GROUP USER KEEP HOLDDATE CTU.

perform bdc_dynpro using 'SAPLS_IMG_TOOL_5' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D0100_FAVORITES_1-PROJECT_ID(01)'.

perform bdc_field using 'BDC_OKCODE'

'=REF_IMG'.

perform bdc_dynpro using 'SAPLSHI01' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=%_GC 126 35'.

perform bdc_dynpro using 'SAPLCRM_IC_PROFILE' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CRMV_IC_PROF-PROFILE(14)'.

perform bdc_field using 'BDC_OKCODE'

'=KOPE'.

perform bdc_field using 'VIM_MARKED(14)'

VIM_MARKED_14_001.

perform bdc_dynpro using 'SAPLCRM_IC_PROFILE' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CRMV_IC_PROF-TEXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=KOPF'.

perform bdc_field using 'CRMV_IC_PROF-PROFILE(01)'

PROFILE_01_002.

perform bdc_field using 'CRMV_IC_PROF-TEXT(01)'

TEXT_01_003.

perform bdc_dynpro using 'SAPLSPO2' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=OPT1'.

perform bdc_dynpro using 'SAPLCRM_IC_PROFILE' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CRMV_IC_PROF-TEXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=SAVE'.

perform bdc_dynpro using 'SAPLSTRD' '0300'.

perform bdc_field using 'BDC_CURSOR'

'KO008-TRKORR'.

perform bdc_field using 'BDC_OKCODE'

'=LOCK'.

perform bdc_field using 'KO008-TRKORR'

TRKORR_004.

perform bdc_dynpro using 'SAPLCRM_IC_PROFILE' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CRMV_IC_PROF-TEXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_dynpro using 'SAPLSHI01' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=TRRT'.

perform bdc_dynpro using 'SAPLS_IMG_TOOL_5' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D0100_FAVORITES_1-PROJECT_ID(01)'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_transaction tables messtab

using 'SPRO'

CTU

MODE

UPDATE.

if sy-subrc <> 0.

subrc = sy-subrc.

exit.

endif.

perform close_group using CTU.

Read only

Former Member
0 Likes
1,039

Any update friends?

Read only

0 Likes
1,039

Hi Usha, For what part of the recording are you getting this

<b>perform bdc_dynpro using 'SAPLSHI01' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=%_GC 126 35'.</b>??

when i do a sample recording for the steps you have mentioned, i did not get any ok_code for this step?

try commenting the high lighted code and see what happens.

Regards,

ravi

Read only

Former Member
0 Likes
1,040

Hi,

Normally one can't use the SPRO for BDC postings. We need to get the actual transaction code which will be used for posting of the data. As mentioned, SPRO>CRM>so..on, u will get to a screen wherein actually the data is been populated. At this point just check the tcode which is been used by SAP and from here do the BDC recording and use the same. Use the transaction code in the call transaction.

Read only

Former Member
0 Likes
1,039

Ramesh,

Tons of thanks for your timely reply.

Regards,

usha

Read only

Former Member
0 Likes
1,039

i already entered t/code 0VRF in my record but i have this error when run the batch

No batch input data for screen SAPLS_IMG_TOOL_5 0100

i don't know where is the issue?