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 from smartforms

deepa22_
Explorer
3,110

I have an requirement to add field ' Lot no.' in smartforms.

for which i need take values from Transaction 'ZSDAH29' .

Is it possible? How to use call transaction in sap?

Can some one help with an example..

It is an urgent requirement!!.

Thanks in advance

I have an requirement to add field ' Lot no.' in smartforms.

for which i need take values from Transaction 'ZSDAH29' .

Is it possible? How to use call transaction in sap?

Can some one help with an example..

It is an urgent requirement!!.

Thanks in advance

12 REPLIES 12
Read only

MateuszAdamus
Active Contributor
0 Likes
2,973

Hi deepa22_

Sure, you can executed ABAP code in the Smartforms form, or better yet, call logic contained in some "external" (not contained in Smartform) class or program.

As to your requirement I see two solutions:

  1. You can execute the transaction and parse the results
  2. or, better in my opinion, you can see what the report called in this transaction does and either copy the logic or execute the very logic that serves your purpose. Seeing as this is a Z* transaction, then analyzing it shouldn't be that hard.

regards,

Mateusz

Read only

0 Likes
2,973

Hi,

we tried that way writing similar logic in our smartforms... But there is prbm, only fews only will come in ZSDAH29 transaction with some barcoded thing, when we write the logic it will apply to all the materials which does not comes into ZSDAH29, so that only customer is asking to use the values from that transaction.

can u please share an example using the call transaction, or can u share any links for me to understand how to use the call transaction in another program..

Read only

0 Likes
2,973

Hi deepa22_

Maybe there is a possibility to move part of the report's logic to a function and then call the same function from the report and smartform? That would be a good solution, too.

If not, if you really have to execute the transaction and parse the output, then what you're looking for is a SUBMIT keyword.
There you must provide:

  1. report's name
  2. selection screen parameters that should be used by report
  3. EXPORTING LIST TO MEMORY parameter - it's crucial, otherwise the results won't be exported to the memory
  4. AND RETURN parameter - required by the EXPORTING LIST TO MEMORY.

After this call you have to use function LIST_FROM_MEMORY to read the exported results from memory into an internal table of type ABAPLIST. Having that you're able to parse the results.

However, I strongly advise on using some other solution (calling a procedure /FORM/ from the report or moving part/whole logic to a function) than parsing the results.

regards,

Mateusz

Read only

0 Likes
2,973

Hi Mateusz,

I tried using submit and return method in my smartforms .. Values are fetching properly..

But facing an problem.. i am getting the output screen of calling program, so that smartforms is not getting printed directly, everytime i am pressing back screen to get the invoice document..?

Kindly help...

Thanks,

Deepa.

Read only

0 Likes
2,973

Hi Deepa

I see two possibilities here:

1. In Smartforms, call a procedure from the report, using PERFORM 'procedure_name' IN PROGRAM 'program_name' and this way get the results. This will work only if the logic of the report is contained in a procedure, of course.

2. Change the report, add selection screen parameter which when checked will make the report to not show any screens.

As mentioned before, moving the report's logic to a separate function is the best option here.

Regards,

Mateusz
Read only

0 Likes
2,973

Hi Mateusz,

1.Changing of selection screen parameters is not possible because that is separate program so..

2.if am using "PERFORM 'procedure_name' IN PROGRAM 'program_name' " , how i will pass the values to fetch data..?

for example..

i need to pass the material number '000000000018003000' from Smartform to calling program as an input ..

how come i will pass these values..

can u please explain with example in passing the value..

thanks in advance 🙂

Read only

0 Likes
2,973

Hi Deepa,

If you're calling a procedure using the PERFORM IN PROGRAM then you can pass to the procedure only what procedure's parameters allow. Nothing else. If the procedure has no parameters but uses global variables, then you either have to call the main report or some other procedure/function that sets the global variables.

Regards,
Mateusz
Read only

Abinathsiva
Active Contributor
0 Likes
2,973

Hi deepa22_

As Mateusz Adamus said coping the logic of z* program to smartform is best way of addressing the requirement.

If it's to be called then it's better write it in DP..

Regards

Abinath S

Read only

0 Likes
2,973

Hi Abi,

when they want from the ztransaction to avoid some other consequences..

Thanks,

Deepa

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,973

Sorry but we can't help, ZSDAH29 is custom, you are the only one to know what it is about.

Please don't pollute with tags which are not related to your question: ABAP RESTful Programming Model | ABAP Connectivity | ABAP Extensibility | NW ABAP Gateway (OData)

Read only

Sandra_Rossi
Active Contributor
2,973

Please ask a developer in your company.

Read only

deepa22_
Explorer
0 Likes
2,973

Is there any other possible way to move the first program data into second program...?

But the parameters or select options gets value from second program..