cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to understand an object/element definition in a SAPScript

Former Member
0 Kudos

Hi,

what does the following block defines in a SAP Script ?

It begins defining an element, like

/E      Element1

Then it defines the contents of the element

/:ADDRESS PARAGRAPH AS
/:  TITLE       &HADRS-ANRED&
/:  NAME        &HADRS-NAME1&, &HADRS-NAME2&
/:  STCEG       &HADRS-STCEG&  "This is a line I am trying to add to the output, but is not being printed
/:  STREET      &HADRS-STRAS&
/:  POBOX       &HADRS-PFACH& CODE &HADRS-PSTL2&
/:  CITY        &HADRS-PSTLZ&, &HADRS-ORT02&
/:  POSTCODE    &HADRS-ORT01&
/:  COUNTRY     &HADRS-LAND1&
/:  REGION      &HADRS-REGIO&
/:  FROMCOUNTRY &HADRS-INLND&
/:ENDADDRESS

What is this ADDRESS object ?! I don't find any referrences to it in the whole code. HADRS-STCEG cointains the proper value at print time, but I can't make it show up in the output. What must I be missing ?

What does the ADDRESS / ENDADDRESS statements define ? How can I access this object ?

There is no place where the program defines Element1, right ? There is only its call via

CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element                  = 'Element1'
              function                 = 'SET'
              window                   = 'DEBDATA'
            EXCEPTIONS
              element                  = 1
              function                 = 2
              type                     = 3
              unopened                 = 4
              unstarted                = 5
              window                   = 6
              bad_pageformat_for_print = 7
              OTHERS                   = 8.

I have no idea what/where to search.

Thanks in advance,

Avraham

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 15, 2009 10:06 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

/E      Element1

Defines a block, that can be reused.


ADDRESS / ENDADDRESS

Defines a block defined as ADDRESS, that means it's giving a special format.


CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element                  = 'Element1'
              function                 = 'SET'
              window                   = 'DEBDATA'
            EXCEPTIONS
              element                  = 1
              function                 = 2
              type                     = 3
              unopened                 = 4
              unstarted                = 5
              window                   = 6
              bad_pageformat_for_print = 7
              OTHERS                   = 8.

Here you are all calling the block called Element1...you can define other blocks and call them the same way...

Greetings,

Blag.

Former Member
0 Kudos

Commenting goes as /*, not /:

Thanks for replying, Alvaro.

The thing I need to add a line of data to the element ADDRESS, but I don't see any call to it in the program. You say that if this element's contents are displayed in the output then there must be a call to it, just like the one for Element1 ?

former_member583013
Active Contributor
0 Kudos

I think I haven't understand your question correctly on the first time...

You say you want to add this line to the Element1 right?


/:  STCEG       &HADRS-STCEG&  "This is a line I am trying to add to the output, but is not being printed

But it's not printed right? Are the other lines printed? Is HADRS-STCEG passing value? I mean...can you see it's value on SE16 by doing a simple query?

Greetings,

Blag.

Former Member
0 Kudos

As far as I understand yes they are, and the item I added - STCEG - is not - although at the moment before FORM_CLOSE it does contain a not initial value.

Where would the subelements of ADDRESS be referred to ? This would already be a clue...

I can't find the referrences to these subelements... and what I am trying to do is exactly adding one.

	  TITLE       &HADRS-ANRED&
 	  NAME        &HADRS-NAME1&, &HADRS-NAME2&
 	  STCEG       &HADRS-STCEG&
 	  STREET      &HADRS-STRAS&
 	  POBOX       &HADRS-PFACH& CODE &HADRS-PSTL2&
 	  CITY        &HADRS-PSTLZ&, &HADRS-ORT02&
 	  POSTCODE    &HADRS-ORT01&
 	  COUNTRY     &HADRS-LAND1&
 	  REGION      &HADRS-REGIO&
 	  FROMCOUNTRY &HADRS-INLND&

former_member583013
Active Contributor
0 Kudos

I haven't work with SapScript since a long time...but I think it should be like this...


CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element                  = 'Element1'
              window                   = 'DEBDATA'
            EXCEPTIONS
              element                  = 1
              function                 = 2
              type                     = 3
              unopened                 = 4
              unstarted                = 5
              window                   = 6
              bad_pageformat_for_print = 7
              OTHERS                   = 8.

Greetings,

Blag.

Former Member
0 Kudos

Didn't help...

Thanks anyway.

I will try to substitute the ADDRESS element for something else.

former_member583013
Active Contributor
0 Kudos

Maybe it's the best way to go...you could create a new paragraph type and use it like...


/E      Element1
P1  TITLE       &HADRS-ANRED&
P1  NAME        &HADRS-NAME1&, &HADRS-NAME2&
P1  STCEG       &HADRS-STCEG& 
P1  STREET      &HADRS-STRAS&
P1  POBOX       &HADRS-PFACH& CODE &HADRS-PSTL2&
P1  CITY        &HADRS-PSTLZ&, &HADRS-ORT02&
P1  POSTCODE    &HADRS-ORT01&
P1  COUNTRY     &HADRS-LAND1&
P1 REGION      &HADRS-REGIO&
P1  FROMCOUNTRY &HADRS-INLND&

Greetings,

Blag.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Avraham Kahana ,

/: means Comment line in script. Please check in the editor and change it. IF it is commented and if u r trying to write it no use of that.

Regards,

Srinivas