cancel
Showing results for 
Search instead for 
Did you mean: 

how to in a transaction catch values of Query and use in another

Former Member
0 Kudos

hello, i have several dropboxes in a screen

the user select values and then press the button "Insert Data" ....at the first view could be an simple Sql Insert but before i have to do some sql queries with the values that the user select for example...in the first dropbox the user choose the area..but he see the area description and in the database have to go the area code...how can i make a Query and then catch the result to use in the insert Query...

another thing...how to call this transaction? i was thinking in put in the button..onclick , and build onefunction that call an transaction..it is possible??

regards

Mário

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Mario,

taking the users input, use it to retrieve some more values and then do some database inserts sounds to me that you should use your "Insert Data" button to call a xacute query that gets the user input as parameter and calls a transaction that does the rest of the logic: prepare and execute the actual insert.

[SAP Help: Xacute Query|http://help.sap.com/saphelp_xmii120/helpdata/en/45/458160db273876e10000000a114a6b/frameset.htm]

Good luck

Michael

Former Member
0 Kudos

thanks Michael, i already thinking like: http://img269.imageshack.us/img269/2623/tinsert.jpg

my problem is that i dont know how to catch the values of the firsts sql querys to use in the insert instruction....should i use the xml results??

could someone explain this??

regards

Mário

Former Member
0 Kudos

Mario,

if you have created the first SQLs, e.g. the SqlGetAreaByDesc, and then click on the action and open the Configuration, click on ok to generate sample XML. This makes it quite easy in the link editor to drag the results of the query to the target fields of your insert.

The usual XPATH expression in the Expression Editor looks like this: "SqlGetAreaByDesc_0.Results{/Rowsets/Rowset/Row/FIELD}"

Hope this help.

Michael

Former Member
0 Kudos

thanks a lot, i was doing a stupid thing i wasnt puting anything in Parameters in the Sql Query and then i put to generate and dont show the ROW part .... stupid

thanks a lot

Mário