cancel
Showing results for 
Search instead for 
Did you mean: 

Display a text conditionally in a form view

Former Member
0 Kudos

Hi Experts,

I have a BAPI being used as a data service in my model.

It returns a table.

If that table is empty, i need to diplay a plain text message "Success".

If the table has atleast one entry, I should display a text message "Not Success".

How can this be achieved in Visual Composer?

Regards,

Ravi Kanth Talagana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

I remember there must be a function in VC, which returns the number of table rows. If not so, you can write a own ABAP RFC, which returns the number of rows.


*Calling the BAPI before counting muste be here
* Sampe ABAP Coding for counting lines of the table
describe table l_t_your_table lines l_number_of_rows.

Hope that helps.

Best Regards,

Marcel

former_member181962
Active Contributor
0 Kudos

Hi Marcel,

Yes, there is an "aggregate" option available in the VC. But how can I use that aggregated value in a condition, without displaying any additional forms?

I don't want to use any custom code. This is a requirement.

Thanks and Regards,

Ravi Kanth

Answers (1)

Answers (1)

Former Member
0 Kudos
  • Drag a line from the output port of the bapi and select "Aggregate Data".

  • Select the new sigma operator that was added to the storyboard and in the configure element task panel select the field that you want to count and in the sigma field select 'count'.

  • Drag a line from the out port of the Sigma operator and select form view.

  • In the "Select Display Fields" box - select the field that the was counted by the sigma.

  • Add a plain text control to the form. Select the control properties and in the Label field at the Display tab write the formula - "IF((@ - select the field from the form>0),'Succeess','Not Success')"

Good-Luck,

Dafna

Former Member
0 Kudos

Hi Dafna,

I never tried it out, but thanks for the solution. Can you add your description to the wiki?

Best Regards,

Marcel

former_member181962
Active Contributor
0 Kudos

Thanks Dafna,

I'll try that and get back.

Thanks Marcel...

Regards,

Ravi