cancel
Showing results for 
Search instead for 
Did you mean: 

Callback to SAP using events in Adobe Designer

Former Member
0 Kudos

Hello, colleagues

Can somebody point me in the right direction how to achieve the following:

Need to hide a salary field on ISR form based on user authorizations in SAP. I was thinking along the lines: when opening the form, execute a callback to ECC validating whether user has authorization to view the field, and set .presence attribute of the field to "invisible". But being completely new to scripting in Adobe and its model I need some help finding:

1. Which event and for which object (page, field, or somewhere else) to better use for this purpose?

2. What the script should look like, assuming I have functionality implemented on backend? I have a suspicion it would be along the lines of:

xfa.record.CONTROL_PARAM.ISR_EVENT.value = "CHECK";
ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");

but am not sure how it links to my functionality. Is there a BADI to implement, or some other mechanism?

Your help will be greatly appreciated!

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Kevin, I did try to use generic services, unfortunately it did not work very well. It retrieves the data I request (or rather, prevents retrieving data user is not allowed to see), but that's where it broke down - once retrieved, upon editing the order, those data are saved with the form, and show up there in the following approval steps the way they were initially retrieved.

As an example - I filled in the form with office clerk authorizations, which do not allow to see salary. After that form got passed to branch manager via approval workflow, the salary data were not available on the form, and the generic service wasn't called upon form retrieval. An opposite example - after form was filled in by branch manager who can see everything, the clerk was able to open the form and see all the data too - again, generic service was not called.

So I'm not sure what else can I do. I mean, I know I should be able to trigger roundtrip to SAP upon opening the form, say, in event form:ready, but the question is - how and where do I define this event. Like in my example, i refer to event CHECK, but I cannot just replace it with 'ZMYEVENT', because there's no code to handle it. And that's what I need help with, finding out what steps to do to create this event and handle it.

Former Member
0 Kudos

Hey Alexei,

OK, let me think of all the steps that need to be done, or at least what I have done and had things working, for a Generic Service...

1...

Run the Define Generic Service for Form Scenarios. Here you create the shell for your generic service. I usually name it starting with the form scenario and some kind of descriptive.

2...

Execute the BAdI: Implement Generic Service. Inside here, the filter value is the name of the generic service that you created. When you create the Enhancement Implementation, use the HRASR00GENERIC_SERVICES.

3...

Execute the Create Operations for Groups of Form Fields. Here you create your Field Groups and the the Operations. Your field groups contain the fields that you want to access when you execute a certain operation. Once you create the field grouping, create an operation and associate the field group with it. Make sure though, when you select your operation and select Assigning Field Groups to Operations, scroll the right side of the screen all the way to the right, and in the column Processing Type, select Check. If this is not selected, your Operation will crash when you call it.

4...

Run the Process Form Scenario for Generic Service. Here you reference all the operations that you have created for the generic service, and then assign the fields to each field group that you call it in. So, if you reference a field in FG2 and FG4 (example field groups), you would have two definitions for the field here.

Outside of this, you can run the Check Consistency of Form Scenarios t-code to make sure that all definitions have been done corrently. You also have to reference all the fields that you define within the BAdI that you create too, inside the method GET_FIELD_INFO. If you don't do field definitions here, the check consistency will always give you a red light...

The way I have explained to do this is the original way in ERP 6.0 before enhancement package 2 came out, which has a transaction that consolidates a lot of the original transactions into one place, trying to less confuse us all...

Hope this helps...

Cheers,

Kevin

Former Member
0 Kudos

Hi Kevin,

Sorry if I was unclear on my previous post, but I do know how to implement and work with generic services. What I do not know, if it's possible to get it to update data in form approval mode, or even form display mode (i.e., when somebody goes to the form after all processing for it is completed). I don't believe that generic services are even executed on display, only Adobe scripts are. So whatever I have to do, it has to be done on both scripting side and backend, not just backend itself.

Former Member
0 Kudos

Hey Alexei,

Sorry, just need to rub the sleep out of my eyes.

If you wanted to change data in the Approval step, I believe that you have to do some workflow configuration to allow the approver to make changes to the form. I think then the step added to the workflow is a different then. I'm not a workflow dude!! The only thing that the approver can do is enter Comments in the New Comments field.

The other thing that you could do is change the read only access behind the elements that you want the approver to be able to access. I'm not sure what would happen in the backend, never tried this myself.

You are right about the service being called. The only thing that happens is the form is loaded with the information passed from the container of the workflow.

Cheers,

Kevin

Former Member
0 Kudos

Yes, Kevin, that's where we do it, HCM P&F. I knew I'd have to replace the CHECK event with something of my own design, the question is what are the steps on backend that I will have to do.

Former Member
0 Kudos

Hey Alexei...

There are a few steps that you have to do in the backend.

1. you have to create the operation

2. you have to assign a field group to the operation

3. if it's a generic service, you have to add the operation to the definition

4. you have to reference the operation in the DO_OPERATION method of your BAdI

Whatever fields you have defined in your field group for the operation, you will have access to.

Check this out too... this might help...

[Settings for Generic Services|http://help.sap.com/erp2005_ehp_02/helpdata/en/46/5afd06ebf05e40e10000000a11466f/frameset.htm]

Cheers,

Kevin

Former Member
0 Kudos

Hi Alexei,

Is this being done in HCM Processes and Forms?

What the line of code that you have shown calls an operation in the backend inside your BAdI as part of an HCM P&F... What you do is replace the "CHECK" with the name of the operation that you have defined in the form configuration. But by the sounds of your wording, this form is developed outside the realm of HCM P&F, but correct me if I'm wrong...

Cheers,

Kevin

Former Member
0 Kudos

hi,

I think u can use RFC's in adobe forms to communicate with SAP.

And according to the output from the RFC set your fields

read the following document

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bfbcd790-0201-0010-679d-e36a3c6b...

Thanks and Regards

shanto aloor

Former Member
0 Kudos

sorry the document is different ....... don't use that.

we cannot communicat to SAP through pure RFC, but using webservices and webservice enabled function modules within SAP we can communicate.

Technically it is quite simple. Create a functionmodule, and create a webservice from that (all SE37 or SE80 but from WAS 6.40). Generate a WSDL (with the Java tool) and import that into the form that you are designing. From there you can bind the data from the dataset (as defined in the WSDL) to screenfields or treat the data any other way Javascript can

And also read the following documents to know more about how to consume webservice in Adobe forms

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f09cf040-237b-2a10-54bb-bbcbf2d4...

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/148ec26e-0c01-0010-e488-decaafae...

Thanks and Regards

shanto aloor