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

Transaction Call

Former Member
0 Likes
1,978

Dear All,

I call a transaction out of a report and pass some values to the called Transaction (with BDCDATA). That works fine, but now I need to know if it is possible to set some of the fields in the transaction to read only that the user can not change the given values. How can I realize this in my report?

Or can I call the transaction and then a variant.

Thanks for your help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,932

Hi matthias,

1. Well, thats not possible.

2. Ie. reading the screen values,

which the transaction has populated.

3. However,

u can read the database tables,

and if u know the logic,

u can detect/know

which values will be there on screen.

regards,

amit m.

Dear All,

I call a transaction out of a report and pass some values to the called Transaction (with BDCDATA). That works fine, but now I need to know if it is possible to set some of the fields in the transaction to read only that the user can not change the given values. How can I realize this in my report?

Or can I call the transaction and then a variant.

Thanks for your help

15 REPLIES 15
Read only

Former Member
0 Likes
1,933

Hi matthias,

1. Well, thats not possible.

2. Ie. reading the screen values,

which the transaction has populated.

3. However,

u can read the database tables,

and if u know the logic,

u can detect/know

which values will be there on screen.

regards,

amit m.

Read only

0 Likes
1,932

If it is not possible to set a field of the called transaction to read-only through Batch Input I need another solution.

Therefore I tried to call a selection variant in this transaction. That works almost fine, it automatically opens the screen where I can choose a variant but then a Pop-Up appears "OK-Code =PICK". Now I have to click ok and after that the variant is loaded. How can I avoid this Pop-Up?

The code look like this:

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

start-of-selection.

perform bdc_dynpro using 'RM06EL00' '1000'.

perform bdc_field using 'BDC_OKCODE'

'/EGET'.

perform bdc_field using 'BDC_CURSOR'

'EL_LIFNR-LOW'.

*Get the right selection-variant

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'08/10'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

Call transaction 'test'

using bdcdata

MODE 'n'

Update 'L'.

FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM.

Read only

0 Likes
1,932

Hi again,

1. very minor mistake

2. use CAPITAL case.

3. N (not n) for mode.

Call transaction 'test'

using bdcdata

MODE '<b>N</b>'

Update 'L'.

regards,

amit m.

Read only

0 Likes
1,932

Now the transaction does not start with MODE 'N'. It starts with MODE 'A', but then I get the described problem.

Read only

0 Likes
1,932

To suppress the Dialog box for ok code, uncheck it in expert tab of options in GUI setting.

Alt+F12 opens the gui settings menu, select Options and then Expert tab.

Regards

Sridhar

Read only

0 Likes
1,932

Thanks for your answer Sridhar.

But If I uncheck the Dialog Box in the GUI Settings then the code "/EGET" and "=PICK" does not appear in a Dialog Box but in the commando field (where I usually type in the transaction numbers)

Regards

Matthias

Read only

0 Likes
1,932

OK codes used in the BDC table appear in the command field, that's how the transaction know where to go when u hit enter in CALL transaction A mode, u should not enter any commands in that field unitil your last OK code (=PICK)is executed, or if you must enter a command to open a new transaction in the middle, remember the ok code in the field and enter the command and re enter the ok code in the field.

BTW i don't think u need to enter any command before finishing all ok codes u've populated in the BDCDATA table.

Regards

Sridhar

Read only

0 Likes
1,932

Thanks

Message was edited by: Matthias

Read only

Former Member
0 Likes
1,932

Hi,

You need to create a transaction variant I guess.

Regards,

Shashank

Read only

Former Member
0 Likes
1,932

Are you running the BDC in foreground? Only then can the user change the values in the fields. Most BDC sessions run in background.

Are you calling a SAP transaction?

Read only

Former Member
0 Likes
1,932

Hello,

Try to create a Screen Variant for this.

If useful reward points.

Regards,

Vasanth

Read only

sridhar_k1
Active Contributor
0 Likes
1,932

To set fields read only, create a selection variant, check protected check box for the field u want to set read only and save it.

GO to transaction SE93, create a transaction code for program and selection screen, in the start with variant field enter the above created varaint name, save it. Use this transaction code in the CALL TRANSACTION.

Regards

Sridhar

Message was edited by: Sridhar K

Read only

0 Likes
1,932

Unfortunately it is not possible to create a screen variant for transaction ME2l (Dynpro 1000). Now I have this problem:

I created a report where I call a transaction. In this transaction I choose a selection variant via BDCData. Everything works fine except for one point. The BDC choose the selection variant through cursor position. But if a user create a new selection variant then my report choose the wrong variant because of the cursor position.

How can I realize that it does not choose the selection variant by cursor position therefore by name of the variant. I tried this but it didnt work:

perform bdc_field using 'RSVAR-VARIANT'

'=NameofScreenVariant'.

At the moment the code with cursor position look like this:

perform bdc_dynpro using 'RM06EL00' '1000'.

perform bdc_field using 'BDC_OKCODE'

'/EGET'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_CURSOR'

'RSVAR-VARIANT(2)'.

perform bdc_field using 'BDC_CURSOR'

'08/10'.

perform bdc_field using 'BDC_OKCODE'

'=PICK'.

Read only

0 Likes
1,932

I'm not refering to screen variant, create regular variant by clicking save button in ME2L. and try steps in my prev reply.

Regards

Sridhar

Read only

0 Likes
1,932

Hi Sridhar,

thank you for your patience.

Your proposal is not possible because I have to call a transaction variant in my report. So I can not use the standard programm (RM06EL00). (If I choose a purchase order in me2l it jumps to me23n where I had to deactivate some buttons - thats why I need the transaction variant.)