This website is not affiliated with, sponsored by, or approved by SAP AG.

SapScript and problems with reading data

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

SapScript and problems with reading data

Postby OmegaM » Tue Sep 28, 2010 2:00 am

Hi.

I'm new in SAP and i'm still have some problems with it.

I'm working with some Form and i need to read data from structre QAMKR and field TOLGRENZE (QAMKR-TOLGRENZE).

But i can't get data in to form if i use &QAMKR-TOLGRENZE&.

Does this means that i have to get some data from the program, and if i must get i will be very happy for example.


Tnx for any reply and help.


Marko
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am

Re: SapScript and problems with reading data

Postby YuriT » Tue Sep 28, 2010 2:17 am

All data you want to access in SapScript should be globally defined and populated in your printing program. Is it?
YuriT
 
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: SapScript and problems with reading data

Postby OmegaM » Tue Sep 28, 2010 2:37 am

Can you pleas give me example for globall define for my issue?

I will be very happy.


Tnx.
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am

Re: SapScript and problems with reading data

Postby YuriT » Tue Sep 28, 2010 6:41 am

In your case it should be something like
Code: Select all
TABLES: QAMKR.
YuriT
 
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: SapScript and problems with reading data

Postby OmegaM » Tue Sep 28, 2010 7:21 am

Thank You YuriT.

I define QAMKR global as u sugest me, but in program called /XYOBJR/QM_CONTROL.

In this program i have multiple section which i use for Logo, header, etc.

To this look in my caise something like that.

*&---------------------------------------------------------------------*
*& Report /XYOBJR/QM_CONTROL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT /PPOBJR/QM_KONTROLA.

tables: T024, KNVK, QAMKR.
*---------------------------------------------------------------------*
* FORM DATA *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> INTAB *
* <-- OUTTAB *
*---------------------------------------------------------------------*
.
.
.
.


Otherwise i'm using FORM named like /XYOBJR/INSP_FORM

Or did i understand u wrong and i should define globaly somewhere else?

Tnx again
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am

Re: SapScript and problems with reading data

Postby OmegaM » Tue Sep 28, 2010 7:27 am

Just a moment, a think a got it!
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am

Re: SapScript and problems with reading data

Postby YuriT » Tue Sep 28, 2010 7:39 am

Would you mind sharing it with everyone in case someone comes across the same problem?
YuriT
 
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: SapScript and problems with reading data

Postby OmegaM » Tue Sep 28, 2010 7:49 am

Yes, no problem, but i still got some problems.

If i want define table globally, does it must be this done in my program like i did in my upper reply, or can i done this in my SapScript FORM?

Tnx.
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am

Re: SapScript and problems with reading data

Postby YuriT » Tue Sep 28, 2010 8:54 am

in printing program as you described above
YuriT
 
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: SapScript and problems with reading data

Postby OmegaM » Wed Sep 29, 2010 12:05 am

SO if i define table globally, than is must still use it somewhere, right?

I mean i maybe have to create some PERFOM in my sap script FORM , like on my example:

Code: Select all
/:       PERFORM TOLERANCE_TEXT IN PROGRAM  /XYOBJR/QM_CONTROL
/:       USING &QAMKR-TOLGRENZE&
/:       CHANGING &TOLGRENZE_TEXT&
/:       ENDPERFORM


and in my program define table globally like i discrabe above and in printing program, make something like:

Code: Select all
*---------------------------------------------------------------------*
*       FORM TOLERANCE_TEXT                                               *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  INTAB                                                         *
*  <--  OUTTAB                                                        *
*---------------------------------------------------------------------*
form TOLERANCE_TEXT tables INTAB structure ITCSY
                       OUTTAB structure ITCSY.
*1 -> &QAMKR-TOLGRENZE&
*1 <- &TOLGRENZE_TEXT& = Text from QAMKR-TOLGRENZE



  data: F_QAMKR type QAMKR.
         .
* To NULL
  clear: F_QAMKR.

* Reading input parameters
  read table INTAB index 1.
  F_QAMKR = INTAB-VALUE.
 

endform.                                   "TOLERANCE_TEXT


But still have to do some write? Or not? I dont know.

After reading input parameters i'v got blackout, i someone can help me.


Tnx
Last edited by Gothmog on Wed Sep 29, 2010 4:27 am, edited 1 time in total.
Reason: added code tags - please use them
OmegaM
 
Posts: 6
Joined: Tue Sep 28, 2010 1:53 am


Return to SAPscript/Smartforms

Who is online

Users browsing this forum: No registered users and 1 guest





This website is not affiliated with, sponsored by, or approved by SAP AG.