‎2008 Aug 27 2:04 PM
I have a program with a selection screen. If i enter the program name and execute , that program should get arranged i.e. Pretty Printed.
Any Suggessions ?
‎2008 Aug 27 2:11 PM
Hi !
Write a BDC for SE38 where you click the 'Pretty Printer'.
Use this BDC in 'N' mode in your program. This way when you enter the program name and execute your report, Pretty Print will take place for the program you entered on the selection screen.
Regards,
Firoz.
‎2008 Aug 27 2:11 PM
Do a recording using SHDB...
Specify SE38...Program Name...Change button...pretty printer button....activate button....back button....
Now, place this code in your program and when program name is specified it does it...
‎2008 Aug 28 4:09 AM
Hi, I have even tried recording mathod, The ok code for Pretty Printer is =ED_PRETTY_PRINT. In recording, the code is not getting rearranged. Have a look at the code.
PERFORM BDC_DYNPRO USING 'SAPLWBABAP' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RS38M-PROGRAMM'.
PERFORM BDC_FIELD USING 'RS38M-PROGRAMM' P_PRGNAM.
PERFORM BDC_FIELD USING 'RS38M-FUNC_EDIT' 'X'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=CHAP'.
PERFORM BDC_DYNPRO USING 'SAPLS38E' '0400'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RSTXP-TDLINE(01)'.
PERFORM BDC_FIELD USING 'RSTXP-TDFIRST' '1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ED_PRETTY_PRINT'.
PERFORM BDC_DYNPRO USING 'SAPLS38E' '0400'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RSTXP-TDLINE(01)'.
PERFORM BDC_FIELD USING 'RSTXP-TDFIRST' '1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ED_PRETTY_PRINT'.
BREAK-POINT.
OPT-DISMODE = 'A'.
OPT-DEFSIZE = 'X'.
CALL TRANSACTION 'SE38' USING IT_BDCDATA OPTIONS FROM OPT.
IF SY-SUBRC EQ 0.
ENDIF.
‎2008 Aug 28 5:07 AM
‎2008 Aug 28 5:11 AM
H i ,
May be Program not in the modify States , thats y its not re arranging the code.....
regards
Prabhu
‎2008 Aug 28 5:15 AM
I have executed the program in All screen mode. The screen is opening in Change Mode only. Any thing more i need to check ?
‎2008 Aug 28 5:22 AM
‎2008 Aug 28 5:29 AM
I have checked the following function modules, but invain
CREATE_PRETTY_PRINT_FORMAT
EDITOR_PRETTY_PRINT
PRETTY_PRINTER
PRETTY_PRINT_PROGRAM
‎2008 Aug 28 6:12 AM
go to SYSTEM menu-----> SETTING there u select prity printer tab & select the desired option.
after that clisk on PP ur program will arrange automatically.
‎2008 Aug 28 6:18 AM
I have done even the pretty printer settings and tested the function modules. They are not working.
‎2008 Aug 28 6:29 AM
Hi,
While recording in BDC,
1. Go to SE38, <program name> -- Change mode.
2. Do pretty printer.
3. SAVE+ACTIVATE.
I think u didnt save the program whlie recording..
Check it out.
Regards,
Prem
‎2008 Aug 28 7:33 AM
Hi Prem,
Once we do SAVE, session ends, we cant activate. But even i tried using sav option also. its not working. Just try from your end also.
‎2008 Aug 28 8:02 AM
‎2008 Aug 28 8:36 AM
I have done the recording and just reprocessed the recorded one. Even then it is not working.
‎2008 Aug 28 8:43 AM
hi friend
the fct code for the pretty printer is '=ED_PRETTY_PRINT'
so with this u can code
just do like this
go to shdb or sm35 start new recording
give ur transaction name
i.e., se38
then just select a program by F4 help select the program which u have already done
and then click on prettty printer
and now save and activate the program
give back
it will take u to the screen consists of bdcdata fields of the recording which u have done.
and now save that recording
and now transfer that recording of the name given by you and transfer to the program
and in that program ur input is nothing but the program name
and if u want some coding u can enter that
and try it , it will work
‎2008 Sep 09 12:36 PM
I have debugged the standard code and adjusted the code accordingly.