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: 

Customized Transaction

Former Member
0 Kudos

Hello Guru,

I've created a new transaction called ZTEST which should transmet some values to another transaction called ZTESTPRIMITIVE which then call a program that show us an external program.

Now, this first transaction ZTEST should be a client specific, each client has different PATH for the external program, every client should add in the transaction ZTEST the PATH and the PROGRAM name.

The problem that when I tippe down the path of that program, it tell's me that some caracters are not allowed, e.g. C:\folder1\folder2 is not permitted, i.e. \, :, ., ...

The same thing happens by PROGRAM.

Remember that transaction ZTEST use ZTESTPRIMITIVE that then set the path and the program and call the external program.

The transaction ZTEST has inside two parameters PATH and PROGRAM.

Thank you for helping me.

Bye.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This message was moderated.

16 REPLIES 16

Former Member
0 Kudos

This message was moderated.

0 Kudos

Hi sachhi,

I've already created the transactions and it works.

What I'm asking for is, that a 2. transaction should use as parameters PATH and PROGRAM and then give to the 2. transaction the value entered by any user (I meant above user instead of client)

I created with SE93 a transaction with parameters which use the 1. Transaction.

Then I tipped in the 2. Transaction.

Path <--- C:\folder1\folder2\

Program <--- Progi.exe

I saved.

When I call the 2. Transaction it gives the values of the parameters to the 1. transaction which execute then the program specified.

I have default parameters on the 1. transaction, but I need a more customized transaction for every user, which can change the path and the program to call different external program.

The path and program may change on different users or different locations.

I hoppe that it's now clear.

ps. My problem is that some caracteres such as :, \, ., ... are not allowed in the parameters

How can I then enter the Path?

Thanks.

Regards,

Kais

0 Kudos

Hello Guru,

Can someone help me please.

I'm really getting in a point of no return.

Because, especially that most of my problems still until now unsolved.

ps. Why most of the people forget that the priority of this forum is to help the people.

Not to get the points.

Thanx.

0 Kudos

you need to debug your program and find where the error coming from. there may be some validation inside your program on the filepath, because of the reason you are getting the errors.

0 Kudos

Hi,

If you want to get the FileName and path, instead of typing it on your own use the below code;

This allows you to select the filename by providing a file open dialog box;

Use the Method file_open_dialog of class cl_gui_frontend_services as given below.

DATA:
    lt_filetable TYPE filetable,
    lf_rc        TYPE i,
    lv_filename(50) TYPE c,
    lv_fileext(3) TYPE c,
    ls_file TYPE file_table,
    lv_file TYPE localfile,
    lv_title TYPE string.

  lv_title = sy-title.
  lv_progname = sy-cprog.

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = lv_title
      file_filter             = '*.txt'
      multiselection          = abap_false
    CHANGING
      file_table              = lt_filetable
      rc                      = lf_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
               DISPLAY LIKE 'E'
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
  ENDIF.

* Number of selected filed must be equal to one.
  CHECK lf_rc = 1.

* Access selected file
  READ TABLE lt_filetable INTO ls_file INDEX 1.

  CHECK sy-subrc = 0.

  lv_file = ls_file-filename.

  SPLIT lv_file AT '.' INTO lv_filename lv_fileext.

Revert back if you need clarifications.

Regards

Karthik D

0 Kudos

Hi Karthik,

Thank you for your reply.

I'm looking for a method where each Client can has its own program on different location on the system.

My role is to provide an interface where each client can save its programname and path on the system and when its done, a transaction on a later time is executed and the specified program is called.

Remember that this program is an external program, not in SAP.

Also, The client must change the programname and the path whenever he want.

So, I need to make it easier and simple.

ps. My implementation is to make 2 Transaction

ChildTransaction call Mother's Tansaction.

ChildTrans. can specify its own path and programname.

But he can't change the Mother's Transaction, he can only execute it.

Thanks.

Best Regards,

Kais

0 Kudos

Hi,

Then my suggestion is to create a Ztable and store the Program name and Path in it so that it can be changed anytime, also using a select query fetch the path and program name from the table and pass it to the WS_EXECUTE Function module.

So now this will make your transaction call program dynamically.

Revert back if you have any doubts.

Regards

Karthik D

0 Kudos

Hi Karthik,

Ok,

But I would also create a transaction which we can modify the pathname and programname.

e.g.

A client can call a transaction called ZMFIRST.

A screen will appear where a programname and path are specified and then can be changed by the user.

I need to ensure that the path exists, so the user should select the specified program rather to type it.

I'll first make it simple then customized later.

So, when its done the user can click on the button save and the Ztable are changed.

But I need also to keep tracking which username it's.

Because every User has its own path and programname to guarantee consistency.

Regrads,

Kais

Former Member
0 Kudos

Hi kais,

Your question is really confusing actually, you are saying like u have created 2 transaction codes, and working fine, but u r again saying path and program which is where i am confused if you can restrict to the point whats the problem you are facing then someone will definitely help you.

Cheers!!

0 Kudos

Hi Balu,

I'll make it jet more clearly.

I've created a second transaction called "transaction with parameter".

If you call se93 and type a transaction name like ZTRAN and click on create, it will appear 4 types.

The last type is create a transaction with parameters.

So I've created this transaction which then call a primitive transaction and then pass 2 parameters.

Remind, that I've entered the name of the primitive transaction on the field transaction.

And then,

This parameters are added on the dynprofields.

This parameters "Path" and "Program" are used to pass the data to the primitive transaction.

The problem by passing the data that I can't enter symbols like \,... which are not allowed.

and I need this symbol to specify my path.

This's the program used by the primitive transaction:



*&---------------------------------------------------------------------*
*& Report  Z_******
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  Z_******.

PARAMETERS path(50) TYPE c
                DEFAULT 'C:\PROGRAM FILES\******\SYS\WIN32\'
                NO-DISPLAY.

PARAMETERS program(20) TYPE c
                DEFAULT '*******.EXE'
                NO-DISPLAY.

DATA: gpath(70) TYPE c.

CONCATENATE path program INTO gpath.

CALL FUNCTION 'WS_EXECUTE'
  EXPORTING
    PROGRAM            = gpath
  EXCEPTIONS
    frontend_error     = 1
    no_batch           = 2
    prog_not_found     = 3
    illegal_option     = 4
    gui_refuse_execute = 5
    others             = 6.

Regards,

Kais

0 Kudos

Here's another explanation.

Call SE93

Created a normal transaction ZFIRST and pass it the program.

Then create a second transaction ZSECOND from type TRANSACTION WITH PARAMETERS (type 4) and then pass to it field transaction ZFIRST.

AND on the fields dynprofields,

Add path and program which will get the appropriate data.

Problem when the path are inserted, it contains symbols like \,u2026 and this symbols are not allowed by the system.

So, I just let there value blank and create the Transaction.

When the Transaction ZSECOND is executed it calls the transaction ZFIRST but the parameters PATH and PROGRAM are blanks.

But no matter, the path and the program are specified as DEFAULT on the program of the Transaction ZFIRST.

So, everything is OK,

But I canu2019t change the PATH dynamically, I need to get in the code and change it,

In this case the utility of ZSECOND is useless.

I wanted a Transaction where each client can specify the Program that he wants to execute.

So everyone can execute the Transaction ZFIRST and ZSECOND, but they are allowed only to change the parameters on the Transaction ZSECOND and not in the Transaction ZFIRST.

To Understand what I met,

check this out.

[http://www.home4sap.com/tips/customse16.shtml]

0 Kudos

Hi kais,

I have framed some concatenation statements which i have worked and it is working fine for me try this hope this will concatenate your path

DATA: V_FILE TYPE STRING.

DATA VFILE TYPE STRING.

VFILE = 'C:\Documents and Settings\Desktop\New\'.

CONCATENATE VFILE WA_ZR-PADNO INTO V_FILE.

VFILE = '.DOC'.

CONCATENATE V_FILE VFILE INTO V_FILE.

On the whole i am trying to concatenate the whole path which i want to trigger C:\Documents and Settings\Desktop\New\asdf0011.doc "where asdf0011 is my wa_zr-padno

Hope my answer helps you.

Cheers!!

0 Kudos

Hey Balu,

I actually met something else.

When you check this link : [http://www.home4sap.com/tips/customse16.shtml]

and go to DATABROWSE-TABLENAME, you see it.

So imagine now that instead of it you have two variables.

First called PROGRAM and its value is empty because of the problem of caracters e.g. \ is not allowed.

The same thing is by PATH.

So when the client call the ZSECOND transaction

It will call ZFIRST with parameters Program = '' and Path = ''.

Remember that on the Program of ZFIRST its specified a default value.

So the default value will be passed like Program = 'default value' ...

And the program will be called.

I want to have it like that because each user can specifiy its path and program.

Just by changing its value on the Transaction ZSECOND.

Unfortunately, it's not working because some caracters are not allowed.

I think that I will make it with an internal table.

I also need a Transaction that provide a user's interface where each user can select the program that he will later call using the Transaction ZFIRST, ZMFIRST will modify the Path and Programname of ZFIRST.

Consistency must be guaranteed, each user has its own path and programname.

Best Regards,

Kais

0 Kudos

Hello, i read this thread. 1st point You have created a transaction code ZFIRST. It is a classical transaction code : - This transaction will call an ABAP program, - This ABAP program has two parameters on the selection screen. ===> why have you decided to not display both selection screen parameters ? 2d point Then you want to create a second transaction code : one per user. This second transaction code is not a classical one : it will be created as explained here[http://www.home4sap.com/tips/customse16.shtml]. You said : "Problem when the path are inserted, it contains symbols like \,u2026 and this symbols are not allowed by the system." ==> Can you confirm that your problem appears at this point : when trying to create the second code transaction using SE93 ? ==> Can you change your abap program by displaying the selection screen parameters :

PARAMETERS path(50) TYPE c
                DEFAULT 'C:\PROGRAM FILES\******\SYS\WIN32\'
                      .
*                NO-DISPLAY.
 
PARAMETERS program(20) TYPE c
                DEFAULT '*******.EXE'
                      .
*                NO-DISPLAY.

==> Then test your program using SE38 : can you insert symbols like \ in the selection screen parameters? If yes, using SE93 try again to create a second transaction code for a user and tell us if you can add symbols in the selection screen parameters ? 4th possible alternative solution -


>Using SE38, try to create variant (one per user) for your ABAP program (called by your first transaction code). Can you try this ? -
>Using SE93, create a transaction code (one per user) that will use the variant created for your user. Can you try this to? Cordialement, Chaouki.

Edited by: Chaouki AKIR on Oct 4, 2008 4:04 PM

0 Kudos

Hi Chaouki,

===> why have you decided to not display both selection screen parameters ?

According to the 1st point, I decided to hide the parameters because everytime when I call the Transaction the programname and path will appear and my goal is just to save them one time and then execute the Transaction as rapidely as possible.

==> Can you confirm that your problem appears at this point : when trying to create the second code transaction using SE93 ?

==> Can you change your abap program by displaying the selection screen parameters :

By the 2nd point, I confirm that my problem appear by creating the second Transaction.

But, if I let the parameters be displayed, everytime when the user execute the 2nd Transaction it will get it programname and path and it's a wast of time in this case.

Because the user doesn't want to see the path but to execute it.

==> Then test your program using SE38 : can you insert symbols like \ in the selection screen parameters?

The symbols on the selection screen parameters can be inserted and the program be executed.

Now, I'll go back to this link [http://www.home4sap.com/tips/customse16.shtml]

To try to make it clear.

For the customied Transaction SE16, there's on the Name Of The Screen Field

DATABROWSE-TABLENAME and as a Value MARA

No imagine that we have the same situation on the Transaction ZSECOND

except that instead of the DATABROWSE-TABLENAME

there's two fields PROGRAM and as a value 'test.exe'

and PATH as a value '***\***\'

Try to insert any of the symbols \,... and press OK, you will see that it's impossible.

This symbols are not allowd.

The only possibility is to save the path on an internal table and to create a Transaction which can modify the PATH and Programname.

e.g. ZMODIFIED will get the path and display it and tell the user if he want change the path and execute it.

The Transaction ZORIGINAL will just get the PATH of the internal table and execute the Program.

0 Kudos

Hello,

I will try to create a transaction code as you indicate with selection screen parameter with a value containing symbols like '/'.

If you can test the abap program so you can create a variant, one per user. Then, you can create a transaction code, one per user, that will call your abap program with the user variant ?

Cordialement,

Chaouki.