cancel
Showing results for 
Search instead for 
Did you mean: 

Pass internal table to workflow container

Former Member
0 Kudos
436

We have written a coding on the method to calculate the Ageing (which is dynamic). and the same is stored in it_gpdata. We want the data in this to be passed to method name Ageing. The parameter used is ZAGE & the coding for calculating zage is written in this parameter. When testing the BO, we are not getting the values in 'Ageing' method. We have maintained multiline in the parameter. Still we are not getting. Please guide.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

"The parameter used is ZAGE & the coding for calculating zage is written in this parameter"

How can you write coding into a parameter?

Is there a good reason to use a method and not an attribute?

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

I have created a method and for that parameter has been created and in the program option i have written the code

former_member185167
Active Contributor
0 Kudos

Hello,

So, no coding in the parameter, there is coding in the method.

How are you fetching the multiline parameter, which macros are you using?

Does it have to be a multiline parameter?

Can't you see how it's done in other methods?

regards

Rick Bakker

hanabi technology

Former Member
0 Kudos

Hi Pooja,

Is your problem solved or not ???

Internal tables are populated or not...

Regards,

Ragavendran.K

Former Member
0 Kudos

No my problem is not solved. I am new to this. Could you help me.

Former Member
0 Kudos

The following is my coding.

data : Ageing type i.

SORT it_gpdata BY GPNUM GPDAT.

SELECT * FROM ZGPHEAD CLIENT SPECIFIED

into corresponding fields of

table it_gpdata

where MANDT = SY-MANDT

and MJAHR = OBJECT-KEY-MATERIALDOCYEAR.

loop at it_gpdata into wa_gpdata.

wa_gpdata-ZAge = Sy-datum - wa_gpdata-GPDAT.

modify it_gpdata from wa_gpdata.

SWC_SET_ELEMENT CONTAINER 'ZAGE' Ageing.

endloop.

eND_METHOD.

My internal table it_gpdata value is not flowing in the method Ageing. (parameter - ZAGE)

it_gpdata has columns GPNUM, GPDAT and sy_datum and Ageing. I want the Ageing value of it_gpdata in Ageing.

Aru
Participant
0 Kudos

Hi pooja

Problem is way you have defined & using the element Ageing . As per you code , every time value of ZAGE will be getting modified , so if suppose 5 entries in the table it_gpdata , only the age of the 5th entry will be present in ZAGE , also you are using SWC_SET_ELEMENT is wrong to set mutli line container

Try like this

Define a internal table for Ageing

Inside the loop remove the macro SWC_SET_ELEMENT & modify statement , and calc age and to the internal table defined

finally use the macro swc_set_table to set the table into the multi line container element ZAGE .

Regards

Arumugam

Former Member
0 Kudos

Hi Pooja,

data : Ageing type i.

SORT it_gpdata BY GPNUM GPDAT.

SELECT * FROM ZGPHEAD CLIENT SPECIFIED

into corresponding fields of

table it_gpdata

where MANDT = SY-MANDT

and MJAHR = OBJECT-KEY-MATERIALDOCYEAR.

loop at it_gpdata into wa_gpdata.

wa_gpdata-ZAge = Sy-datum - wa_gpdata-GPDAT.

modify it_gpdata from wa_gpdata.

endloop.

swc_set_table CONTAINER 'it_gpdata' it_gpdata.

eND_METHOD.

i hope this will help you ...

regards

RameshG

Former Member
0 Kudos

can you provide me the coding.

Former Member
0 Kudos

Pooja

above code will work

try that ...

Former Member
0 Kudos

Thanks for your feedback Ramesh. But my method naming is Ageing and the parameter is ZAGE. What you have mentioned after the container is it_gpdata. Should i changed this to Ageing or ZAGE. My internal table is it_gpdata. I am confused. Could you please explain

Former Member
0 Kudos

Hi Pooja,

data : Ageing type i.

SORT it_gpdata BY GPNUM GPDAT.

SELECT * FROM ZGPHEAD CLIENT SPECIFIED

into corresponding fields of

table it_gpdata

where MANDT = SY-MANDT

and MJAHR = OBJECT-KEY-MATERIALDOCYEAR.

loop at it_gpdata into wa_gpdata.

wa_gpdata-ZAge = Sy-datum - wa_gpdata-GPDAT.

modify it_gpdata from wa_gpdata.

endloop.

swc_set_table CONTAINER 'zage' it_gpdata.

eND_METHOD

paste the the code as it is

in the workflow containr ZAGE reference table should be same like it_gpdata and parameter should be multiple

then it will work

Former Member
0 Kudos

But Ramesh, how will i test my BO for my method Ageing, if i am using my workflow container ZAGE. Further it_gpdata is not an ABAP table it is the internal table created and passed in the code. Please help

Former Member
0 Kudos

Pooja,

IF standard table is not there then you can create a custom table same like your internal table use that table in the container as a refernece table.

testing

Put the break point in your coustom method

Pass then necessarey parameters to the BOR

then exute the BOR

You can able to see now how the values are passing the interble

Let me know if any problem

regards

RameshG

Former Member
0 Kudos

I saw in the debug mode the values are flowing in the internal table it_gpdata.

You mean to say that if in the debug mode, the values are flowing in the internal table then i should only look in the workflow teting whether values are flowing in the container. Am i right.

Is it not necessary to see the values in my method Ageing in the BOR test. Please clarify.

Former Member
0 Kudos

yes Pooja correct .

if your getting the values in it_gptable thats enough

below macro will take care of moving the it_gpdata to zage container

swc_set_table CONTAINER 'zage' it_gpdata.

and container values you cann't see in debug mode here

so start your workflow testing

Regards

RameshG

Former Member
0 Kudos

As suggested by you i have set the code and did the workflow testing. I have created container element as ZAGE with reference table as zmt044_gphead. automatically two container elements ZAGE1 and ZAGE 2 got created and binding done. Hence manually set the binding for the container element ZAGE created by me. Did the testing. When i checked the workflow log for values in container element, i am not getting the values.

My container element, import export and multiline set. But not getting the values in the container element.

Former Member
0 Kudos

Hi Pooja,

Have a created the paremaeters to your custom method in the business object .

If the parameters are there then problem with binding

check the binding praperly

it will work

Regards

RameshG

Answers (0)