Application Development 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: 

Sap Script INCLUDE

Former Member
0 Kudos

Hi,

How to check if Sap Script INCLUDE is not empty?

INCLUDE &VBDPA-TDNAME& OBJECT VBBP ID Z003 LANGUAGE &NAST-SPRAS& PARAGRAPH LL

If include is empty then LANGUAGE has to be E (English).

How to achieve this?

Adibo..:)

6 REPLIES 6

Former Member
0 Kudos

Hi

You can first check the Text in the Related Order Item Level for that ID Z003in the VA03 Sales order.

Programatically to check means, we have to modify the Driver program

or Call a subroutine from the Script using PERFORM statement and passing the Order no, ITEM No and ID z003

use the fun module READ_TEXT to get the text into an internal table.

If that itab is initial, you pass some parameter to script, else pass another paramter back to script, so based on that parameter(variable) you can kkep a condition

You have to pass OBJECTNAME (concatenation of VBELN+POSNR) OBJECT as VBBK and the ID as Z003 and Lang etc

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hello Adibo,

1. Write a Perform to aceive this.

2. In this perform check whether the value is empty or not.

3. If the value is empty then select the value for the same in language English and move that into this .

4. Now pass this to the script.

Check this for writing Performs in scripts :

http://www.sap-basis-abap.com//abap/how-to-call-a-subroutine-form-sapscripts.htm

Hope this ud help u.

Reward if it helps.

Regards,

Deepu.K

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

The Form :

/:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK

/:USING &EKKO-EBELN&

/:CHANGING &CDECENT&

/:ENDPERFORM

The report :

REPORT zkrpmm_perform_z1medruck .

DATA : BEGIN OF it_input_table OCCURS 10.

INCLUDE STRUCTURE itcsy.

DATA : END OF it_input_table.

  • déclaration de la table output_table contenant les

variables exportées

DATA : BEGIN OF it_output_table OCCURS 0.

INCLUDE STRUCTURE itcsy.

DATA : END OF it_output_table.

DATA : w_ebeln LIKE ekko-ebeln,

  • w_vbeln LIKE vbak-vbeln,

w_zcdffa LIKE vbak-zcdffa.

*----


*

  • FORM CDE_CENT

*

*----


*

FORM cde_cent TABLES input output.

it_input_table[] = input[].

it_output_table[] = output[].

READ TABLE it_input_table INDEX 1.

MOVE it_input_table-value TO w_ebeln.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = w_ebeln

IMPORTING

output = w_ebeln.

SELECT SINGLE zcdffa FROM ekko

INTO w_zcdffa

WHERE ebeln = w_ebeln.

it_output_table-name = 'CDECENT'.

MOVE w_zcdffa TO it_output_table-value.

MODIFY it_output_table INDEX 1.

output[] = it_output_table[].

ENDFORM.

Regards,

Sree

Former Member
0 Kudos

Hmmm..I wantend to read SY-SUBRC after calling INCLUDE, but that don't work!

So I have to modify the Driver program, ZRVADOR01. Before calling /E (element) check with READ_TEXT if exist and pass VAR_LANGUAGE.


INCLUDE &VBDPA-TDNAME& OBJECT VBBP ID Z003 LANGUAGE &VAR_LANGUAGE& PARAGRAPH LL 

thanks all.

Adibo.

Former Member
0 Kudos

Hi,

I found SAPSCRIPT-SUBRC

IF &SAPSCRIPT-SUBRC& = 4 

SAPSCRIPT-SUBRC = 4, But It never enter into de IF statement

???

Former Member
0 Kudos
IF &SAPSCRIPT-SUBRC& = ' 4'

There must be SPACE between ' and 4: -


> ' 4'