Application Development 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: 

help in Call transaction & set parameter

Former Member
0 Kudos

hi guys,

This is regarding trasaction CU50.

In CU50 after entering material and plant, when 'F8' is pressed the control is transfered from intial screen to screen, say x .Now how to do this in report.

Using set parameter I have filled the mandatory fields in CU50 but, how to set function code.

Cant use skip intial screen option because intial screen has itself as next screen.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Nithin

You could try to call the transaction using function module

FUNCTION ABAP4_CALL_TRANSACTION.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(TCODE) LIKE  SY-TCODE
*"             VALUE(SKIP_SCREEN) LIKE  SY-FTYPE DEFAULT SPACE
*"             VALUE(MODE_VAL) LIKE  SY-FTYPE DEFAULT 'A'
*"             VALUE(UPDATE_VAL) LIKE  SY-FTYPE DEFAULT 'A'
*"       EXPORTING
*"             VALUE(SUBRC) LIKE  SY-SUBRC
*"       TABLES
*"              USING_TAB STRUCTURE  BDCDATA OPTIONAL
*"              SPAGPA_TAB STRUCTURE  RFC_SPAGPA OPTIONAL
*"              MESS_TAB STRUCTURE  BDCMSGCOLL OPTIONAL
*"       EXCEPTIONS
*"              CALL_TRANSACTION_DENIED
*"              TCODE_INVALID
*"----------------------------------------------------------------------

Use the TABLES parameter <b>SPAGPA_TAB</b> to set any required parameters.

Use the TABLES parameter <b>USING_TAB</b> to set any required Batch-Input steps.

Use the parameters in the following recommended combinations:

- skip_screen & spagpa_tab

- using_tab without skip_screen and spagpa_tab

Another service that this function module offers is the authority-check for the called transaction.

Regards

Uwe

7 REPLIES 7

Former Member
0 Kudos

After setting the parameters do this

CALL TRANSACTION CU50 AND SKIP FIRST SCREEN.

This will take you to the second screen (i.e. equivalent to filling data in CU50 first screen and pressing F8)

Regards

Kathirvel

venkata_ramisetti
Active Contributor
0 Kudos

Hi Nitin,

YOu have to write code like following...

SET PARAMETER ID 'MAT' FIELD V_MATNR.

SET PARAMETER ID 'WRK' FIELD V_WERKS.

CALL TRANSACTION 'CU50' AND SKIP FIRST SCREEN.

Thanks

Ramakrishna

Former Member
0 Kudos

hi guys,

thanks for replying but skip first screen is not working..it shifting control back to initial screen..guess dis because for the first screen say 30 has next screen field as 30 so the control is shifting back to first screen..

regards,

nithin

0 Kudos

do a recording of CU50 in SM35. Then you can generate a program from this recording and then cut and paste code into your own program.

0 Kudos

Nitin,

Please check the below code. I tested in my SAP system and it is working fine.

I wrote a small program for this. Please check this.

REPORT ZCU50 .

PARAMETERS: MATERIAL TYPE MATNR,

PLANT TYPE WERKS_D.

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = MATERIAL

IMPORTING

OUTPUT = MATERIAL.

SET PARAMETER ID 'MAT' FIELD MATERIAL.

SET PARAMETER ID 'WRK' FIELD PLANT.

CLEAR BDCDATA.

BDCDATA-PROGRAM = 'SAPLCUKO'.

BDCDATA-DYNPRO = '0030'.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

CLEAR BDCDATA.

BDCDATA-FNAM = 'BDC_OKCODE'.

BDCDATA-FVAL = '=GOON'.

APPEND BDCDATA.

CALL TRANSACTION 'CU50' USING BDCDATA MODE 'E'.

WRITE:/ MATERIAL, PLANT.

Please let me know if you have any doubts.

Thanks

Ramakrishna

uwe_schieferstein
Active Contributor
0 Kudos

Hello Nithin

You could try to call the transaction using function module

FUNCTION ABAP4_CALL_TRANSACTION.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(TCODE) LIKE  SY-TCODE
*"             VALUE(SKIP_SCREEN) LIKE  SY-FTYPE DEFAULT SPACE
*"             VALUE(MODE_VAL) LIKE  SY-FTYPE DEFAULT 'A'
*"             VALUE(UPDATE_VAL) LIKE  SY-FTYPE DEFAULT 'A'
*"       EXPORTING
*"             VALUE(SUBRC) LIKE  SY-SUBRC
*"       TABLES
*"              USING_TAB STRUCTURE  BDCDATA OPTIONAL
*"              SPAGPA_TAB STRUCTURE  RFC_SPAGPA OPTIONAL
*"              MESS_TAB STRUCTURE  BDCMSGCOLL OPTIONAL
*"       EXCEPTIONS
*"              CALL_TRANSACTION_DENIED
*"              TCODE_INVALID
*"----------------------------------------------------------------------

Use the TABLES parameter <b>SPAGPA_TAB</b> to set any required parameters.

Use the TABLES parameter <b>USING_TAB</b> to set any required Batch-Input steps.

Use the parameters in the following recommended combinations:

- skip_screen & spagpa_tab

- using_tab without skip_screen and spagpa_tab

Another service that this function module offers is the authority-check for the called transaction.

Regards

Uwe

Former Member
0 Kudos

hi guys,

thanks u guys for ur replies.

But , my problem is still unsolved .

In both cases i.e, recording or using BDC , the next screen which I am getting is subscreen but not the entire screen.

Ramakrishna , If you run the code you have provided, and compare it with the screen you get when u run cu50 (after entering the matnr & werks and pressing F8), you will notice the difference in the screens.

Once again thank you guys for ur intrest.

regards,

Nithin