Application Development and Automation 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: 
Read only

sapscript help~

Former Member
0 Likes
451

Hi!

i would like to retrieve a data using sap script. In the table LFBK, after i entered a vendor (LIFNR), i get 2 rows of data. My analyst currency in the BVTYP column, so the 1st row of the data is in <b>USD</b>, 2nd row of data is <b>GBP</b>.

in my sapscript, I would like to write:

if &REGUD-WAERS& is GBP, then get 2nd rows of data that BVTYP is also GBP.

if BVTYP is empty, then always get the 1st row of data.

should i write as below:


/:   IF &REGUH-BVTYP& eq ' '
*   Beneficiary Bank,,  :    &REGUD-ZBNKA&
*   Branch,,,,,,       &REGUD-ZBSTR&

/:   ELSEIF &REGUD-WAERS& EQ &REGUH-BVTYP&
*   Beneficiary Bank,,  :    &REGUD-ZBNKA&
*   Branch,,,,,,       &REGUD-ZBSTR&

/:  ENDIF

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
415

Hello,

Handling the data from the script it is not posible,u have to do in print program or using subroutines.If u are using standard print program use subroutines concept and extract data according to ur condtion and display them in ur script.

Let me know in more clear,so that I can help u.

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
415

hi there!

i wonder why if my BVTYP is GBP, it didn't go into the if and the elseif (because 1st row is USD, 2nd row is GBP). and no result is displayed.

Do i need to add any coding for it to loop through the LFBK table to match the WAERS (GBP) to BVTYP (GBP)?

please help.

thanks a lot!

Read only

Former Member
0 Likes
416

Hello,

Handling the data from the script it is not posible,u have to do in print program or using subroutines.If u are using standard print program use subroutines concept and extract data according to ur condtion and display them in ur script.

Let me know in more clear,so that I can help u.

Regards

Read only

0 Likes
415

Hi!

I created a subroutine on standard program and have solved it. thanks a lot!

Read only

former_member186741
Active Contributor
0 Likes
415

if your program is using LFBK then so must the sapscript..... but it is referring to REGUD and REGUH. THey need to be consistent.