‎2007 Oct 16 8:38 AM
<b><u>I have a Macro defined as below:</u></b>
-macro-for-form-definition----
DEFINE M_OPEN.
----
FORM F_DSOPEN_&1_&2 *
----
This is a macro to dynamically open unix files *
----
--> dsn *
--> type *
--> c *
----
FORM F_DSOPEN_&1_&2 USING
P_XPATH.
DATA MSG(80).
OPEN DATASET P_XPATH FOR &1 IN &2 MODE MESSAGE MSG.
V_SUBRC = SY-SUBRC.
IF SY-SUBRC <> 0.
CONCATENATE V_DESC29 P_XPATH INTO V_DESC.
PERFORM F_CREATE_IT_ERR USING ' ' V_DESC.
ENDIF.
ENDFORM.
END-OF-DEFINITION.
<u><b>After that I am using that Macro as below:</b></u>
M_OPEN INPUT BINARY.
M_OPEN OUTPUT TEXT.
<u><b>Showing Error as below:</b></u>
ERROR: In "TEXT MODE" the "ENCODING" addition must be specified
<u><b>Solutions tried:</b></u>
I was suspecting that error for Open Dataset and added text mode / encoding for it. Still the problem is showing up.
So I guess some change should take place for M_OPEN statements.
ANY CLUES PLEASE.
Thanks
Kiran
‎2007 Oct 16 8:54 AM
OPEN DATASET P_XPATH FOR &1 IN &2 MODE MESSAGE MSG ENCODING DEFAULT.
Maybe you can have a try to add "ENCODING DEFAULT".
I hope it will be helpful.
‎2007 Oct 16 8:58 AM
I already told that I gave a try in that area.
Thanks for the reply.
Any more clues pl
Kiran
‎2007 Oct 16 10:15 AM
‎2007 Oct 16 10:20 AM
OPEN DATASET P_XPATH FOR &1 IN &2 MODE MESSAGE MSG <b>encoding default</b>.
Thats the solution. If you tried and had no success, you made a mistake.
The encoding phrase is mandantory in unicode, you dont have that, and therefore you will get an error.
And at least: using a macro to have a form is more than strange. Forms can have parameters.
‎2007 Oct 16 10:26 AM
Hi Kiran,
Please do not use Macro. Instead use a subroutine if you wish to reuse the code.
ENCODING DEFAULT is the only solution.
Simply remove macro & paste the code of open dataset along with encoding default & check.
Best regards,
Prashant
‎2007 Nov 19 7:00 AM
slved on my own.
defined 2 macros.
one for text
another for binary