Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas:Scripting with RFC-Functionmodules: Problems with Import-Structure

0 Kudos

Hi Experts,

I want to change master material data (plan price (field mbew-zplp1) in transaction MD04

with help of function module BAPI_MATERIAL_SAVEDATA.

The problem for me is the mapping of the import parameters with

when not only a single field is set but a structure.

Under

http://wiki.scn.sap.com/wiki/display/Img/How+to+call+Remote+Enabled+ABAP+Function+Modules+in+Persona...

please see attached Graphic1.png

I found an example which has also a structure as import parameter

Above Method JSON-stringify is used. I tried to reproduce it in our system.

But unfortunately it is not working because of 2 reasons.

  1. The function module is not working without a “COMMIT WORK” at the end.

I could simulate this writing a small ABAP-Programm which is calling the function module.

Without “COMMIT WORK”-Statement at the end of the program the FM is not updating.

How can I handle this in the script.

  1. Something seems to be wrong (syntax?) in the Method JSON-stringify.

What not logical is that the content of field FIRSTNAME is between ‘’ and the content of field LASTNAME is between “”.

Further I debugged (screenshot below) and found out that the script is also transferring the fieldnames not only

the data to the structure. So the function module is going to fail. Could you please help me with

the syntax in the javascript, that the fields of the structure are populated correctly ?

Thanks a lot.

please see attached Graphic2.png

Regards Jürgen

  • SAP Managed Tags:
9 REPLIES 9

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You could call the FM BAPI_TRANSACTION_COMMIT right after BAPI_MATERIAL_SAVEDATA.

  • SAP Managed Tags:

0 Kudos

Thanks a lot, Tamas.

  • SAP Managed Tags:

0 Kudos

That will solve the first part of my problem.

  • SAP Managed Tags:

0 Kudos

Hi Tamas,

I implemented it and it did work.

Thanks a lot. Have you got a proposal how to assign

values from Javascript to an ABAP Structure ?.
If I do in example mentioned before it won't work,

cause fieldname would also be assigned to the import

structure. How is the correct syntax in JS that ABAP

can assign the received values to the required fields

of the structure ?

I could only do it with a workaround where I build a

big string and assign the values to the particular offset.

But this is very uncomfortable and error-prone.

Thanks for your help. Regards Juergen.

  • SAP Managed Tags:

0 Kudos

Hi Jurgen,

There is currently some work going on for passing structure from personas script.

I would suggest you to create a css message so that you can be informed when the note is out.

OR

wait for our support mail when the note is out

(http://support.personas.help)

Sushant

  • SAP Managed Tags:

0 Kudos

Hi Sushant, thanks a lot.

Regards Juergen.

  • SAP Managed Tags:

0 Kudos

can you please tell me where I can create a css message, Sushant.

  • SAP Managed Tags:

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

It means creating an incident. Go to the SAP Support Portal (https://support.sap.com) and click on 'Report an incident'.

  • SAP Managed Tags:

0 Kudos

Thanks, Tamas, I am going to do that.

  • SAP Managed Tags: