Application Development and Automation 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: 
Read only

sap scripts

Former Member
0 Likes
346

Hi Guys,

can i call a function module in a window of a sap script. please reply urgently.

can this be done using the perform statement.

points will be rewarded generously.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
326

try this..

PERFORM FUNCTION_MODULE IN PROGRAM ZXXXXXXXXX
USING &FIELD1&
USING &FIELD2&
CHANGING &FIELD3&
ENDPERFORM.

2 REPLIES 2
Read only

Former Member
0 Likes
326

Hi,

<b>No, you can not call FM from SAPScript window.</b>

You can only call subroutine of extermal program.

Let's say the logo in your SAPScript is dynamically determine based on Company code. Then you call the external subroutine line this.

/*   *&*** Define symbol for LOGO **********************************&* 
/:   DEFINE &ZLOGO& = ' '.                                                    
/:   DEFINE &ZOBJECT& = ' '.                                                  
/:   DEFINE &ZID& =' '.                                                       
/:   DEFINE &ZCOLOR& = ' '.                                                   
/:   DEFINE &ZDPI& = ' '.                                                     
/*                                                                            
/*   *&*** Call form routien GET_LOGO to get LOGO detail  ***********&* 
/:   PERFORM GET_LOGO IN PROGRAM ZRMM_POPOOL                                  
/:   USING &EKKO-BUKRS&                                                       
/:   CHANGING &ZLOGO&                                                         
/:   CHANGING &ZOBJECT&                                                       
/:   CHANGING &ZID&                                                           
/:   CHANGING &ZCOLOR&                                                        
/:   CHANGING &ZDPI&                                                          
/:   ENDPERFORM                                                               
/*                                                                            
/*   *&***** DISPLAY LOGO ******************************************&* 
/:   BITMAP &ZLOGO& OBJECT &ZOBJECT& ID &ZID& TYPE &ZCOLOR& DPI &ZDPI&

The FORM routine in program will look like this.

FORM get_logo TABLES input_tbl STRUCTURE itcsy
                     output_tbl STRUCTURE itcsy.

*"........ Your code here.

ENDFORM.

Regards,

RS

Read only

Former Member
0 Likes
327

try this..

PERFORM FUNCTION_MODULE IN PROGRAM ZXXXXXXXXX
USING &FIELD1&
USING &FIELD2&
CHANGING &FIELD3&
ENDPERFORM.