cancel
Showing results for 
Search instead for 
Did you mean: 

Get data in sap script

01-26-2022 1:26 PM
miske Participant
509 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

Hello everyone,

I need to display MATNR from table VBAP in the table in main window of a sap script.
How do I do that?


This is what I tried:
in txt element i wrote

/:   PERFORM get_matnr IN PROGRAM ZGET_matnr
/: USING &VBAP-MATNR& /: CHANGING &SIFRA& /: ENDPERFORM

and in my program I wrote this:

FORM get_matnr TABLES  itab  STRUCTURE itcsy
otab STRUCTURE itcsy.
DATA: sifra TYPE vbap-matnr.

READ TABLE itab WITH KEY name = 'VBAP-MATNR' TRANSPORTING value.
sifra = itab-value.

otab-value = sifra.
MODIFY otab TRANSPORTING value WHERE name = 'SIFRA'.

But when I type &SIFRA& where I need my data to be displayed I dont get any values.
I also saw while debbuging that when I want to get some data from BSEG, I can do that, but from VBAP I cant.

Can anyone help I need a reply ASAP.
Thanks in advance.

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

miske
Participant
0 Likes

Any answer that helps would be highly appreciated. Please help.