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

dIALOGUE pROGRAMMING

Former Member
0 Likes
1,160

Hi friends,

I am developing a module pool program,

I have to do Initialiazation.

which part of the program should i write my initialiazation code.

Any suggestions,

Madhu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,132

Hi,

It will trigger the PBO event..

Make sure your code is not within a condition..

Do one thing..Put a break-point in your program...Then check..

Thanks,

Naren

11 REPLIES 11
Read only

Former Member
0 Likes
1,132

Hi,

You have to write in the PBO event..

PROCESS BEFORE OUTPUT.

MODULE INITIALIZE.

MODULE INITIALIZE.

  • If you want to do it for the first time..

  • create a variable in the top include with value as 'X'.

IF V_FIRST = 'X'.

  • Do all the variable initializing for the first time..

CLEAR V_FIRST.

  • Clear the variable V_FIRST to make sure it is not called again..

ENDIF.

ENDMODULE.

THanks,

Naren

Read only

0 Likes
1,132

Thanks Naren,

I have written it in this way, but it is not triggering.

Whats the reason for it.

Madhu

Read only

Former Member
0 Likes
1,133

Hi,

It will trigger the PBO event..

Make sure your code is not within a condition..

Do one thing..Put a break-point in your program...Then check..

Thanks,

Naren

Read only

0 Likes
1,132

Thanks Naren and Venki.

The PBO is triigering even before the screen is displayed.

My requirement is when i execute the code i need the first screen to be displayed and i input the date in the screen like select options and with these values i need to perform the rest of code.

Madhu.

Read only

0 Likes
1,132

PBO is triggered before the display of the screen.

But readin the thread it seems your requirement is to accept some values from the screen and then do some coding.If it is so, then this will come in PAI instead of PBO.

Like this -

chain.

field pprhp-rozt.

module input_status on chain-request.

endchain.

Regards,

Amit

Read only

0 Likes
1,132

Thanks Amit,

Yes u r right. I have to read from screen and do my processing on it.

The reason I was using initialization I have to use some like select-options.

So i was using initialiazation

INITIALIZATION.

r_pwwrk-SIGN = 'I'.

r_pwwrk-OPTION = 'EQ'.

r_pwwrk-LOW = l_pwwrk.

r_pwwrk-high = h_pwwrk.

APPEND r_pwwrk.

Thanks Naren for the FM.

madhu.

Read only

0 Likes
1,132

So your problem is solved or not now.

If not then for this code, just do chain-endchain on this field in PBO and write module for it in that only.

Regards,

Amit

Read only

0 Likes
1,132

Thanks Amit,

I am thinking of writing it as a report program in SE38.

Suppose i have got everything to an Internal table in se38 report program and from there i would like to call a dialogue program which has table control.

How do i call it.

Madhu.

Read only

0 Likes
1,132

Check this might help you -

module in the ABAP program that has been defined using

MODULE <mod> OUTPUT.

...

ENDMODULE.

In the PAI, POH, and POV events, you can use the statement to call any dialog module in the

ABAP program that has been defined using

MODULE <mod> [INPUT].

...

ENDMODULE.

It is technically possible to have two dialog modules with the same name in the same program,

one defined using OUTPUT, the other with INPUT. However, this is not recommended.

Since dialog modules in an ABAP program can be called from more than one screen, you can

program functions that you need in several screens centrally in a single module. For example, it

is usual to copy the contents of the OK-code field into an auxiliary variable and then reset the

field in all PAI events. You could program this task in a single module that you would then call

from the PAI event of all screens.

If you need to distinguish between screen numbers in a dialog module, you can use the system

field SY-DYNNR, which always contains the number of the current screen. This would allow you,

for example, to analyze the function code in a single PAI module and then control the further

program flow according to the screen number and function code.

Regards,

Amit

Read only

Former Member
0 Likes
1,132

Hi ,

All the variables used in module pool program(all sceens) should be declared in TOP module

If you declare in PBO and use the same vaiable in PAI then then it will through a syntax error.

It's just like declaing in a form.If you declae it in a form its applicable to that form , out side that form it doesn't work

similaly if you are a variable in both PAI and PBO you have to declare in TOP module.

similarily if you initiliaze a value declae that vaue in TOP module and where ever you use that variable it holds that value uncless you clear it in you code.

Let me know if iam not clear

Thanks

venki

Read only

Former Member
0 Likes
1,132

Hi,

To get select options in the dialog programming use the FM COMPLEX_SELECTIONS_DIALOG

Search SDN with the FM ..You will get lot of sample programs..

Thanks,

Naren