cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the cases in button action?

Former Member
0 Kudos

Hi Experts,

I want to get a prompt message if the field is empty.I got it but at the same time if the field is filled I want the other action to be performed that is to call a BAPI and give me output.How can I give two events for the same action.

How to use the cases in button action?

So, please guide me.Urgent need

Regards

Nutan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nutan,

if I understand you, then you have a simple validation. Therefore you can use the validation functionality of VC for your components. An alternative could be by writing a new ABAP RFC function module like:

BAPI Input parameters as input and BAPI output parameters as output and an additional return code or string for a message:

IF I_FIELD IS INITIAL.

E_RETURN_CODE = "THE FIELD IS EMPTY."

ELSE.

CALL FUNCTION <YOUR_BAPI>

<BAPI PARAMETERS>

ENDIF.

I hope that helps.

Best Regards,

Marcel

Former Member
0 Kudos

Hi Marcel,

Thanks for your reply.If I am not using the New Bapi as you have mentioned then how can use the case in VC.

Example:

Bool(If(@RoleCd=="",'Enter the Code', HERE I WANT TO CALL THE BAPI FOR FALSE CONDITION)

How to get this?How can I give the event name in the false exp?Is it necessary to use the New Bapi as you have mentioned.If not then please help me out in VC itself?

Regards

Nutan

Former Member
0 Kudos

Hi Nutan,

I think you have to enter a value into an input field and then click on a button.

So you can add a formula so that the button is disabled if the input field is empty, e.g. ISNULL(@filed) or the user can click on the button and a guard condition decides which of the two action will be done.

E.g. ISNULL(@filed) for showing the error message in a plaintext (passing the message to a data store and the plaintext field refers to the data store value) and !ISNULL(@field) for passing the data to the BAPI.

Best Regards,

Marcel

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nutan,

How are you populating your field? By query, BAPI...

Regards,

Gilson