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

activating program in runtime.

Former Member
0 Likes
1,857

hai friends ,

any body tell me can we activate our program in the runtime. because i make some changes in our program in runtime will it affect before the output.actually it reflecting when i exicute 2 nd time.

1 ACCEPTED SOLUTION
Read only

former_member222860
Active Contributor
0 Likes
1,768

Hi,

Check this FM, it activates the Report/ Program dynamic

REPS_OBJECT_ACTIVATE

thanks\

Mahesh

13 REPLIES 13
Read only

Former Member
0 Likes
1,768

This logic rebuilds an INCLUDE MODULE then generates it and then runs it.

I used this logic to build IMPORT and EXPORT functions that allowed me to dynamically unload and then load a DB Table from one instance to another. It would recompile based on table structure.


*&---------------------------------------------------------------------*
*&      Form  build_include_ZYDIMPORTIN
*&---------------------------------------------------------------------*
FORM build_include_zydimportin.
  SELECT SINGLE * FROM dd02l WHERE tabname = p_tabnam.

* Determine the table/structure visible length
  SELECT * FROM dd03l WHERE tabname = p_tabnam.
    IF dd03l-leng GT 0.
      rec_len = rec_len + dd03l-leng.
    ENDIF.
  ENDSELECT.

  CHECK rec_len GT 0.

  DELETE REPORT 'ZYDIMPORTIN'.

  IF dd02l-tabclass NE 'INTTAB' AND
     dd02l-tabclass NE 'APPEND'.

    CONCATENATE 'tables' p_tabnam '.' INTO i_report-line
                SEPARATED BY space.
    APPEND i_report.

    CLEAR i_report-line.
    APPEND i_report.

  ENDIF.

  if p_tabnam = 'ZSPSUMM'.
    rec_len = rec_len + 2.
  endif.

  SHIFT rec_len LEFT DELETING LEADING '0'.
  CONCATENATE 'data data_str(' rec_len ').' INTO i_report-line.
  APPEND i_report.

  INSERT REPORT 'ZYDIMPORTIN' FROM i_report.

  GENERATE REPORT 'ZYDIMPORTIN'.

ENDFORM.                    " build_include_ZYDIMPORTIN

Read only

0 Likes
1,768

hi iam inserting some text elements in the runtime it is reflecting when i exicute the report at 2 nd time.

for reflecting same changes in runtime what can we do.

Read only

0 Likes
1,768

Hi

It will definately affect when you run the program second time .But make sure the program finishes the execution the first time completely and correctly .

Hint : There are some RFC function module that attach dynamically and be a part of other program by getting activated to it.

Read only

0 Likes
1,768

hi iam making changes to same program

Read only

0 Likes
1,768

Hi,

As far as i have understood your question.

Do an screen navigation and come back to the original screen where the text element was activate .

Let me know if it served your purpose ?

Read only

0 Likes
1,768

no not like that ,i am chnging the value of taxt elemements of an standard program.we have a statement in standard one.so before that i want to change the value .then it will display my value.i think its vary clear ,

now tell me how can we do?

Read only

0 Likes
1,768

No .THis is not possible.

SAP follows a technic called 'FLUSHING' concept wherien the changes in ( PBO or PAI ) of a screen happens only on some occasion..

My suggestion is to traverse a screen and get back to the screen .

(screen field transportation happens at this time from repository )

Updating the screen element(text element is ofcourse a screen elemet) seems to be not possible being on the same screen.

Moreover the text element updated should be activate every time.

eg:

Activate text-elemt .

Make changes to it.

Activate. (At this step it wont reflect the changes immediately )

Navigate

See the changes

Read only

former_member222860
Active Contributor
0 Likes
1,769

Hi,

Check this FM, it activates the Report/ Program dynamic

REPS_OBJECT_ACTIVATE

thanks\

Mahesh

Read only

0 Likes
1,768

thanku

Read only

0 Likes
1,768

hi thanku but it is not reflecting to changed text elements.

Read only

0 Likes
1,768

Hi sudheer,

As i told previously changes wont me happening immediately .

Read only

0 Likes
1,768

hi friend ,

can u give any alternate solution.

Read only

0 Likes
1,768

Hi Friend,

you can use BDC to activate the program at runtime....

use the code given below to activate the program at runtime....

data:   bdcdata like bdcdata    occurs 0 with header line.


start-of-selection.



perform bdc_dynpro      using 'SAPLWBABAP' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'RS38M-PROGRAMM'.
perform bdc_field       using 'BDC_OKCODE'
                              '=AKTI'.
perform bdc_field       using 'RS38M-PROGRAMM'
                              'YH1307_RAD'.
perform bdc_field       using 'RS38M-FUNC_EDIT'
                              'X'.
perform bdc_dynpro      using 'SAPLSEWORKINGAREA' '0200'.
perform bdc_field       using 'BDC_OKCODE'
                              '=WEIT'.


call transaction 'SE38' using bdcdata mode 'N' update 'S'.

*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
form bdc_dynpro using program dynpro.
  clear bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  append bdcdata.
endform.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
    clear bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    append bdcdata.
endform.

regards,

Siddarth