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

Call Transaction question

Former Member
0 Likes
1,276

Hi All

I am developing a program which read a list of transactions(t_progs)and run them one by one and them store in an internal table(t_progsErr) all the transactions that was NOT execute successfull .

But the problem is that some of this transactions has obrigatory parameters which might occur in errors.

Anyone has an idea how can I solve this ?

The code is somethin like this:

loop at t_progs.

select single *

from tstc

where pgmna = t_progs-name.

call transaction tstc-tcode.

commit work and wait.

check if the line after start of selection was executed and record in case of error****

move-corresponding t_progs to t_progsErr.

endloop.

Thank you very much in advanced.

Br.

Cristina

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,247

Instead of calling the transaction you might want to use the SUBMIT report USING SELECTION-SETS OF PROGRAM prog AND RETURN option.

Hi All

I am developing a program which read a list of transactions(t_progs)and run them one by one and them store in an internal table(t_progsErr) all the transactions that was NOT execute successfull .

But the problem is that some of this transactions has obrigatory parameters which might occur in errors.

Anyone has an idea how can I solve this ?

The code is somethin like this:

loop at t_progs.

select single *

from tstc

where pgmna = t_progs-name.

call transaction tstc-tcode.

commit work and wait.

check if the line after start of selection was executed and record in case of error****

move-corresponding t_progs to t_progsErr.

endloop.

Thank you very much in advanced.

Br.

Cristina

11 REPLIES 11
Read only

Former Member
0 Likes
1,247

I'm not completely clear on the issue. What would you like to happen with the programs that contain obligatory parameters?

Read only

andrea_galluccio2
Contributor
0 Likes
1,247

Hi Cristina,

you should create default variant for the programs that needs obligatory parameter and use this default variant in the transaction code.

Hope it helps

Bye

Andrea

Pls reward if it helps

Read only

0 Likes
1,247

Will this be running only for executable programs? If so, to expand upon Andrea's suggestion, once you have created a variant for each, you could run the program using "SUBMIT report USING SELECTION-SET 'VARIANT' AND RETURN" instead of using the call transaction on the T-code.

Read only

Former Member
0 Likes
1,247

hi,

<b>Call transaction <tcode> using <BDCTAB>

Mode <A/N/E>

Update <S/A>

Messages into <MSGTAB>.

</b>

Parameter – 1 is transaction code.

Parameter – 2 is name of BDCTAB table.

Parameter – 3 here you are specifying mode in which you execute transaction

A is all screen mode. All the screen of transaction are displayed.

N is no screen mode. No screen is displayed when you execute the transaction.

E is error screen. Only those screens are displayed wherein you have error record.

Parameter – 4 here you are specifying update type by which database table is updated.

S is for Synchronous update in which if you change data of one table then all the related Tables gets updated. And sy-subrc is returned i.e., sy-subrc is returned for once and all.

A is for Asynchronous update. When you change data of one table, the sy-subrc is returned. And then updating of other affected tables takes place. So if system fails to update other tables, still sy-subrc returned is 0 (i.e., when first table gets updated).

Parameter – 5 when you update database table, operation is either successful or unsuccessful or operation is successful with some warning. These messages are stored in internal table, which you specify along with MESSAGE statement. This internal table should be declared like BDCMSGCOLL, a structure available in ABAP/4. It contains the following fields:

Regards,

Santosh

Read only

Former Member
0 Likes
1,248

Instead of calling the transaction you might want to use the SUBMIT report USING SELECTION-SETS OF PROGRAM prog AND RETURN option.

Read only

0 Likes
1,247

Hi all

Thank you very much for all replies.

The programs are type (TRDIR-SUBC = 1), i.e, executable programs.

And what I really want is when I call the transaction(s), all the obrigatory parameters/select options to be ignored.

Many Thanks.

Cristina

Read only

0 Likes
1,247

Hi

NO! You can't do it! U've create default variants where those parameters and/or sel are filled....or you change the programs of course

Max

Read only

0 Likes
1,247

One possible way to do what you want is to read the source code of the program using READ REPORT. Loop through the line and look for obligatory parameters. Modify the code in this internal table to remove the obligatory requirement. Use the INSERT REPORT command to create a new program, followed by GENERATE REPORT to activate. Run the new program and check your results. When complete use DELETE REPORT command to remove the program and start over with the next transaction. Of course, it's hard to anticipate what kind of issues you might encounter by not providing inputs into these fields that should be populated, but this will get you past the required fields.

I assume this is a continuation of the issue from yesterday. Just out of curiosity, what are you trying to determine?

When it comes time to find the obligatory statements, try this:

LOOP AT itab.

TRANSLATE itab-line TO UPPER CASE.

REPLACE 'OBLIGATORY' IN itab-line WITH SPACE.

MODIFY itab.

ENDLOOP.

You will have to get creative if any of the selection screen fields are defined in an include program.

Message was edited by: Michael Malvey

Read only

0 Likes
1,247

Thank you all for your replies.

Michael, yes this is something to do with the test that I started yesterday. And your solution once more is very useful, thank you very much !

Br.

Cristina Neale

Read only

Former Member
0 Likes
1,247

Hi,

use set parametter id to set default value

for trassactionj having obligatory field

v_matnr = 'test'.

set paramter id 'MAT' field v_matnr

call transaction mm03 and skip first screen.

Regards

amole

Read only

Former Member
0 Likes
1,247

You can't do what you want that is the reason for the OBLIGATORY option on the parameters or select-options. You must either use the set paramter id option explained in one of the treads or create a variant that has the mandatory fields and use the SUBMIT report option.