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: 

problem with insert prg

Former Member
0 Kudos
110

Hi Experts

I have placed the Insert Prg(standard prg) statement in my Zprg and after running it the standard prg main program is missing or deleted, when i go se80 the main prg is not there and remaing includes are there and changes occured with my user name.

i am wondering how the standard program coding will delete without the key

anyone let me know what happened and how to solve this

Thanks in advance

karthik

1 ACCEPTED SOLUTION

Former Member
0 Kudos
87

When you did the INSERT prog statement, it actually overwrites the program taking the code from your internal table. IT REALLT DOES NOT MATTER WHETHER IT IS A STANDARD PROG or custom one.

You can do one thing - take a copy of the at particular prog ( from a diff server accessible to you) into a .txt file and use the same prog to upload the code from the text file and do a INSERT prog again. In that way you will be able to rewrite the program. Thats the only way out. ( as because you can not modify a standard SAP program using SE38 or SE80).

5 REPLIES 5

former_member223537
Active Contributor
0 Kudos
87

Hi Karthik,

You are correct. Standard program cant be deleted unless you have the key.

Log off & then Login. Check & let us knw if the problem still persists.

Best regards,

Prashant

Former Member
0 Kudos
88

When you did the INSERT prog statement, it actually overwrites the program taking the code from your internal table. IT REALLT DOES NOT MATTER WHETHER IT IS A STANDARD PROG or custom one.

You can do one thing - take a copy of the at particular prog ( from a diff server accessible to you) into a .txt file and use the same prog to upload the code from the text file and do a INSERT prog again. In that way you will be able to rewrite the program. Thats the only way out. ( as because you can not modify a standard SAP program using SE38 or SE80).

0 Kudos
87

Hi SKC,

Thaks for the reply but I don't how to do this

Can you pls send the steps to do that

Thanks in advance

karthik

0 Kudos
87

First you get a copy of the code that actually existsed. You can have that from a differ server. Hope getting the older version of the code is not a problem for you. Just do a Copy and Paste and Save it in a text file.

Once you do that use the following code -


REPORT  ZSKC_PROG_EDIT.

DATA : T_CODE TYPE CHAR72 OCCURS 0 WITH HEADER LINE.

PARAMETER : P_PROG TYPE PROGRAMM.

START-OF-SELECTION.

CALL FUNCTION 'UPLOAD'
  TABLES
    DATA_TAB                      = T_CODE[]
  EXCEPTIONS
   CONVERSION_ERROR              = 1
   INVALID_TABLE_WIDTH           = 2
   INVALID_TYPE                  = 3
   NO_BATCH                      = 4
   UNKNOWN_ERROR                 = 5
   GUI_REFUSE_FILETRANSFER       = 6
   OTHERS                        = 7.

   CHECK SY-SUBRC EQ 0.

   MESSAGE I000(OO) WITH 'OVERWRITING PROGRAM' P_PROG.

   INSERT REPORT P_PROG FROM T_CODE.

   IF SY-SUBRC EQ 0.
     WRITE 'CODE HAS BEEN WRITTEN.'.
   ELSE.

     WRITE 'ERROR IN WRITING'.
   ENDIF.

You just pass the name of the main prog which was overwritten, then it will ask you for the File that contains the code - you pass your text file containing the code. Executing this will solve ur problem.

test it with a Z prog created by you. You will understand it for urslef.

Best of Luck !!

0 Kudos
87

hi SKC,

Thanks for the information you have given, the program worked and i got back the orginal coding in standard report but one more problem When I execute the standard report the GUI status is missing,

Pls let me know how to solve this

Thanks

karthik