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

Module-pool programing help

0 Likes
1,389

Sir

I want help regarding the Module pool programing.

Please help me.

The problem description is as follows.

On the layout editor , i have reterived one filed LIFNR from the table MSEG and put the listbox coding for it by using the POV event and function module F4IF_INT_TABLE_VALUE_REQUEST.and the list is also showing vendor numbers on executing the program.

Now further i have selected all the address fields from the same table MSEG on the layout editor.

Now the problem is that when i select the vendor number on the executable screen , i want the address fields automatically get filled according to the vendor number.

For eg ,we have selected 1000 as a vendor number then the address corresponding to 1000 automatically gets display in the respective fields.

For this i don;t know the logic.Please help me .

I will be grateful to all to help me as soon as possible.

Points will be awarded to the best satisfactory answer.

The much more important point is that i will learn a new concept.

Thanks a lot

12 REPLIES 12
Read only

Former Member
0 Likes
1,367

Hareesh, I'm not sure I fully understand what you are trying to achieve, but you could set up a structure and an internal table to disply the relevant data.

1. Set up a structure containing the fields you wish to display.

2. Set up an internal table referencing the structure

DATA: it_table LIKE zstructure OCCURS 0 WITH HEADER LINE.

3. Create a table control

CONTROLS: cont_table TYPE TABLEVIEW USING SCREEN nnnn.

4. Create table control on your screen and use the "Dictionary/program fields window" button to load the fields of the structure which you wish to display into the table control.

5. Populate the internal table in a PBO event.

6. Loop at the internal table into your structure as follows:

LOOP AT it_table INTO zstructure

WITH CONTROL cont_table

CURSOR cont_table-current_line.

ENDLOOP.

Read only

Former Member
0 Likes
1,367

HI,

Use function module DYNP_VALUES_READ for this purpose.

Regards,

Kasi S

Read only

0 Likes
1,367

please elaborate the answer and tell me how to use this function module

Read only

Former Member
0 Likes
1,367

if your requirement is when you choose the value from list box(drop down box) it should fetch the value to other fields then do like this.

in layout you have already defined the input box as list box by selecting the drop down option in the property window there you can find fct code input box in that window just assign any fn code like SEL or something to that.

now in your PBO module write the code for fetching the value in other fields.

module filldata output.

if not <screenfield lifnr> is initial.

select f1 into <screen field> from dbtab where lifnr = <screen field lifnr>

endif.

endmodule.

regards

shiba dutta

Read only

0 Likes
1,367

What is the use of the function code.

We are not using that function code anywhere.

Also i have done what you have said but i m not getting the output.

So tell now what to do and where to use that function code SEL or anything else.

Read only

0 Likes
1,367

What is the use of the function code.

We are not using that function code anywhere.

Also i have done what you have said but i m not getting the output.

So tell now what to do and where to use that function code SEL or anything else.

Read only

0 Likes
1,367

Hi Hareesh,

check the link below, it has answers for ur questions

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Also check this demo program

<b>DEMO_DYNPRO_DROPDOWN_LISTBOX</b>

Read only

Former Member
0 Likes
1,367

Hi Hareesh,

read the return table parameter <b>RETURN_TAB</b> of the fm <b>'F4IF_INT_TABLE_VALUE_REQUEST</b>' after selecting the value of the vendor and use the fm <b>'DYNP_VALUES_UPDATE</b>' to update the address fields based on the value read from the table <b>RETURN_TAB</b>

Read only

Former Member
0 Likes
1,367

the fn code does not do anything just it will trigger PAI when you select any value from the list box(drop down) and then it will trigger the PBO so only you can get the result. because you have to write the code in PBO and for triggering PBO on the value selection from list box you have to trigger PAI. so assign the fcode no need to code any thing extra for that fcode. by the way just paste your code here...

we can try to solve that.

regards

shiba dutta

Read only

0 Likes
1,367

&----


*& Report Z_DELIVERY_PUZZ *

*& *

&----


*& *

*& *

&----


REPORT z_delivery_puzz .

TABLES : mseg,lfa1.

DATA : BEGIN OF it_lfa1 OCCURS 0,

lifnr LIKE lfa1-lifnr,

END OF it_lfa1.

DATA : BEGIN OF it_addr OCCURS 0,

name1 LIKE lfa1-name1,

stras LIKE lfa1-stras,

ort01 LIKE lfa1-ort01,

ort02 LIKE lfa1-ort02,

pstlz LIKE lfa1-pstlz,

END OF it_addr.

CALL SCREEN 1000.

&----


*& Module f4_lifnr_pov INPUT

&----


  • text

----


MODULE f4_lifnr_pov INPUT.

SELECT lifnr FROM lfa1 INTO TABLE it_lfa1.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'LIFNR'

value_org = 'S'

TABLES

value_tab = it_lfa1

  • RETURN_TAB = ITAB

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*

ENDMODULE. " f4_lifnr_pov INPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


MODULE user_command_1000 INPUT.

CASE sy-ucomm.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

&----


*& Module status_1000 OUTPUT

&----


  • text

----


MODULE status_1000 OUTPUT.

if not it_lfa1-lifnr is initial.

SELECT name1

stras

ort01

ort02

pstlz FROM lfa1 INTO (it_addr-name1,it_addr-stras,it_addr-ort01,it_addr-ort02,it_addr-pstlz) WHERE lifnr = it_lfa1-lifnr.

endselect.

endif.

ENDMODULE. " status_1000 OUTPUT..

*FLOW LOGIC CODING

PROCESS BEFORE OUTPUT.

MODULE status_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS ON VALUE-REQUEST.

FIELD LFA1-lifnr MODULE f4_lifnr_pov.

*LAYOUT EDITOR

LIFNR FIELD IS SELECTED FROM TABLE LFA1.

REST ADDRESS FIELDS ARE SELECTED FROM IT_ADDR INTERNAL TABLE FROM THE PROG.

Read only

0 Likes
1,367

NOW ITS SHOWING THE OUTPUT BUT THE PROBLEM IS THAT WHEN I CHANGE THE VENDOR NUMBER FROM THE LISTBOX THEN ALSO IT SHOWS THE SAME ADDRESS .

ITS NOT CHANGING THE ADDRESS ACCORDING TO THE VENDOR NUMBER.

PLEASE HELP ME AND ALSO TELL ME WHERE TO USE THIS FUNCTION MODULES

lIKE DYNP_READ_VALUES

DYNP_READ_UPDATE

AND WHEN TO USE RETURN_TAB FIELD OF THE FUNCTION MODULE

F4IF_INT_TAB_VALUE_REQUEST.

Read only

0 Likes
1,367

I GOT THE PROBLEM THAT BY DEFAULT MY VENDOR GET SELECTED IS

"YELLOW_FRT" AND ITS DISPLAYING THE ADDRESS OF THIS VENDOR.

EVEN I M CHANGING THE VENDOR NUMBER FROM THE LISTBOX THEN ALSO VALUE IS NOT CHANGING .

so TELL ME THE SOLUTION FOR THIS PROBLEM.

I HAVE GIVEN THREE QUESTIONS STILL ONE REPLY HAS NOT COME.