cancel
Showing results for 
Search instead for 
Did you mean: 

A Column in Query - To be filled dynamically - HOW?

Former Member
0 Kudos

Dear Experts,

We have an InfoSet and a query on top of it. In the query, we have 3 hidden columns for 3 different characteristics.

We want to have 4th column in our query which would be displayed to the user. This 4th column has to be dynamically populated based on the values of fields in the 3 hidden columns.

Our initial guess is to do using some sort of customer exit but not really sure how to do it.

Any suggestions how we can technically implement this logic?

Regards

X

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi XZ,

I had a similar case as yours and I was able to solve it by implementing Virtual Char/KF. Brian Anthony had pointed me to a doc which helped me. You can look at the thread "Virtual Char/KF Question" for details on my question.

Document on Virtual Char/KF:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e473ab90-0201-0010-22ac-fdd925ca...

Let us know if this solves your problem.

Thanks.

Regards,

bw_newbie

Former Member
0 Kudos

Hi XZ,

You can create a formula key figure for filling the fourth column(Status).

Let say the key figures are KF1, KF2 and KF3 and the formula key figure is FK1.

Steps

((KF1 <> 0)KF1) + ((KF1 == 0)(KF2 <> 0)KF2) + ((KF1 == 0)(KF2 <> 0)(KF3 == 0)KF3)

Hope this helps you.

Regards,

Yokesh.

Former Member
0 Kudos

Hi Yokesh,

Thanks but in this case, these 3 columns are characteristics and not key figures hence we can not implement this.

Regards

X

former_member185132
Active Contributor
0 Kudos

X,

Which version of Bex are you using, 3.5 or 7?

I think the easiest technique is to use a macro. First execute the query with the Delivery Block, Credit Block, Billing Block as visible. See the columns they occupy. In the macro, you will need to insert a new column just after these 3, copy the values as required, and then delete the rows of the three columns. You will have the output.

Depending on whether you are in 3.5 or 7, you will need to write the code in the SAPBEXOnRefresh or callback macro functions in your workbook.

Former Member
0 Kudos

Dear Suhas,

We can't use Macros as this query is a part of web template to be displayed on portal.

Thanks for your inputs though....

Regards

X

Former Member
0 Kudos

Hi,

U have to use Formula Variable with Processing Type as Customer Exit.

in CMOD t-code create a project or use the project where all ur coding will be written.

In this use Enhancement RSR00001.

In this u have to use Exit_SAPLRRS0_001 to write ur code.

REDDY

Former Member
0 Kudos

Can you tell us what the hidden columns contain and how they are populated. And are they static or dynamic and are you using any variable in those three columns?. Need more inputs to advice...

Former Member
0 Kudos

Hi,

Those 3 columns do not contain any variables.

They are Delivery Block, Credit Block, Billing Block.

Our logic is to first check if Delivery Block <> BLANK, if so then display the value of Delivery Block in 4th Column (Status). If Delivery Block = BLANK, then we have to check Credit Block <> BLANK, If so then display the value of Credit Block in 4th Column (Status). If Credit Block = BLANK, then we have to check Billing Block <> BLANK, If so then display the value of Billing Block in 4th Column (Status).

Please let me know if you need more inputs.

Regards

Abhijit