on 01-12-2024 5:08 AM
Hi Guys,
I need to do the mass creation from Fiori to Backend using SAP BAS.
For that, I prepared the JSON payload in array format and need to send to backend system in Base64 format.
How to convert the below payload in Base64 format in SAP BAS.
Example Payload:
[
{ "RoleName": "ZTEST_ROLE1" },
{ "RoleName": "ZTEST_ROLE2" },
{ "RoleName": "ZTEST_ROLE3" },
{ "RoleName": "ZTEST_ROLE4" },
{ "RoleName": "ZTEST_ROLE5" }
]
Regards,
Tamilselvan
Hi
i am little confuse, why you are coverting it into base64?
"need to send to backend system in Base64 format" why it is needed?
we have create deep to send multiple in backend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Please find the below answer.
Payload:
var oEntryArray = [];
var oEntry = {};
oEntry.RoleName = "ZTEST_ROLE1";
oEntryArray.push(oEntry);
var oEntry = {};
oEntry.RoleName = "ZTEST_ROLE2";
oEntryArray.push(oEntry);
To convert the above array to BASE64 format, I used the below syntax and it worked.
var base64 = btoa(JSON.stringify(oEntryArray));You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.