2007 Jul 11 9:37 AM
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..:)
2007 Jul 11 9:49 AM
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
2007 Jul 11 9:51 AM
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
2007 Jul 11 10:09 AM
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
2007 Jul 11 10:29 AM
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.
2007 Jul 11 12:58 PM
Hi,
I found SAPSCRIPT-SUBRC
IF &SAPSCRIPT-SUBRC& = 4 SAPSCRIPT-SUBRC = 4, But It never enter into de IF statement
???
2007 Jul 11 1:13 PM
IF &SAPSCRIPT-SUBRC& = ' 4'There must be SPACE between ' and 4: -
> ' 4'