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 : Table control example from SAP technical.com

Former Member
0 Likes
3,298

hi all,

im new to abap..

i'm practicing module pool programing..i'm trying a table control example from SAP technical.com

in that example..i'm getting an error like statement not accessible..

this error is occuring at the statement : call screen 130.

i'm unable to find the error..

can any body help me regarding this issue...

the program is like this..

TABLES : MARA.

TYPES: BEGIN OF ST_MARA,

MATNR TYPE MARA-MATNR,

ERSDA TYPE MARA-ERSDA,

ERNAM TYPE MARA-ERNAM,

LAEDA TYPE MARA-LAEDA,

END OF ST_MARA.

DATA: IT_ST TYPE TABLE OF ST_MARA,

WA_ST TYPE ST_MARA,

IT_MARA TYPE MARA,

WA_MARA TYPE MARA,

OK_CODE LIKE SY-UCOMM.

CALL SCREEN 130.

&----


*& Module V1 INPUT

&----


  • text

----


MODULE V1 INPUT.

WHEN 'SAVE'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.

MOVE-CORRESPONDING WA_ST TO WA_MARA.

INSERT INTO MARA VALUES WA_MARA.

WHEN 'DELETE'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.

MOVE-CORRESPONDING WA_ST TO WA_MARA.

DELETE MARA FROM WA_MARA.

WHEN 'MODIFY'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.MOVE-CORRESPONDING WA_ST TO WA_MARA.

MODIFY MARA FROM WA_MARA.

ENDCASE.

ENDMODULE. " V1 INPUT

&----


*& Module EXIT INPUT

&----


  • text

----


MODULE EXIT INPUT.

IF OK_CODE = 'EXIT'.

LEAVE PROGRAM.

ENDIF.

ENDMODULE. " EXIT INPUT

21 REPLIES 21
Read only

Former Member
0 Likes
2,330

Hi,

i.e syntax problem.

call screen '0130'. < try this way.

Regards,

Naveen.

Read only

0 Likes
2,330

hi naveen,

thank you for your quick reply..

i tried this but of no use..

Read only

0 Likes
2,330

after using the syntax that Naveen has stated , Please check wheather the screen(130) is active ot not .

If not , then activate the same .

Read only

0 Likes
2,330

i checked it..

screen 130 is in active state.

Read only

0 Likes
2,330

Hi,

CALL SCREEN 130 should be under PBO , as it is not under any of teh events like PBO/PAI, it is not accessible.

Keep it under PBO and try .

revrt back..

Regards,

Naveen

Read only

former_member195698
Active Contributor
0 Likes
2,330

what is the type of Program that you have created ???

Read only

0 Likes
2,330

its module pool program..

Read only

0 Likes
2,330

Hi,

CALL SCREEN 130 should be under PBO , as it is not under any of teh events like PBO/PAI, it is not accessible.

Keep it under PBO and try .

Regards,

Naveen

Read only

0 Likes
2,330

Can u send the Exact code that you are using ?

If the one provided above is the actual code, then the statemen .. CASE is missing in the code.

There is ENDCASE but no CASE.

Read only

0 Likes
2,330

why this call screen 0130 statement is for?

is there any problem if that statement is not there?

Read only

0 Likes
2,330

call s reen statement call the normal screen designed in the screen painter.in your case it will call the screen designed as normal screen with screen number 130, with 3 command button on it .

Pooja

Read only

0 Likes
2,330

Hi,

You have created a Screen called 0130? If yes the do you want to see the screen with all the fields on it then you have to tell the system to by using this call statement.

Did you you get any error while activating? Check it. Coy i copied the code you have pasted here and it didn't give me the error you where talking about.

Thanks,

Prashanth

Read only

0 Likes
2,330

Hi, Harini

Have you Created the Screen 0130 using SE51 ? i think you didn't do that.

Please Reply iif you didn't.

Kind Regards,

Faisal

Read only

0 Likes
2,330

i created the screen...but i think there is some problem regarding modules..

i have n't uncommented any of the modules..but created modules exit and v1.

Read only

0 Likes
2,330

Hi Satish,

I have gone through the same example that you mentioned in saptechnical.com but i found no problem with the way they did.

Have you created both report program and screen with the same name and screen number 130 and activated?

what do you mean by not uncommented any of the modules? type your flowlogic here.

I suggest you go through help.sap.com and understand how the flow works in Flow logic of module pool instead of just seeing an example. Because it will help you in creating your own screens however you want if you understand the flow of program in module pool.

try this link.

http://help.sap.com/SAPhelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

Best regards.

Aswath.

Edited by: aswathsa on Mar 10, 2012 12:35 AM

Read only

0 Likes
2,330

Before anyone else answers, please see the date of the OP.

Rob

Read only

Former Member
0 Likes
2,330

Hi,

Try this CALL SCREEN 0130.

Hope this might help you.

Thanks,

Prashanth

Read only

0 Likes
2,330

its not working..

Read only

Former Member
0 Likes
2,330

Hi,

I guess you need to create the screen with number 130 assigned to it in se80 or by double click on screen ,it will prompt you to create the new screen simply click yes it will automatically take you to acsreen painter ,and in that screen you need to create 3 command button with fn code as SAVE,DELETE and MODIFY.

Read about module pool/doalogue programming or search forum how to design the screen in screen painter etc. for better understanding.

Need not to bother much,simply serach the net and the forum,go throug ABAP in 21 days for quick help.

All the very best.

Hope it help you.

Pooja

Read only

Former Member
0 Likes
2,330

Two possible solutions are:

1) Change your program type to Executable from Module Pool

2) Make a Tcode for ur module pool and call screen 130 thro Tcode. Remove Call screen 130. line from ur program

Read only

Former Member
0 Likes
2,330

Dear Friend,

Please remove CALL SCREEN 130 in your program try this below code.

TABLES : MARA.

TYPES: BEGIN OF ST_MARA,

MATNR TYPE MARA-MATNR,

ERSDA TYPE MARA-ERSDA,

ERNAM TYPE MARA-ERNAM,

LAEDA TYPE MARA-LAEDA,

END OF ST_MARA.

DATA: IT_ST TYPE TABLE OF ST_MARA,

WA_ST TYPE ST_MARA,

IT_MARA TYPE MARA,

WA_MARA TYPE MARA,

OK_CODE LIKE SY-UCOMM.

  • CALL SCREEN 130. Remove this

&----


*& Module V1 INPUT

&----


  • text

-


MODULE V1 INPUT.

WHEN 'SAVE'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.

MOVE-CORRESPONDING WA_ST TO WA_MARA.

INSERT INTO MARA VALUES WA_MARA.

WHEN 'DELETE'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.

MOVE-CORRESPONDING WA_ST TO WA_MARA.

DELETE MARA FROM WA_MARA.

WHEN 'MODIFY'.

WA_ST-MATNR = MARA-MATNR.

WA_ST-ERSDA = MARA-ERSDA.

WA_ST-ERNAM = MARA-ERNAM.

WA_ST-LAEDA = MARA-LAEDA.MOVE-CORRESPONDING WA_ST TO WA_MARA.

MODIFY MARA FROM WA_MARA.

ENDCASE.

ENDMODULE. " V1 INPUT

&----


*& Module EXIT INPUT

&----


  • text

-


MODULE EXIT INPUT.

IF OK_CODE = 'EXIT'.

LEAVE PROGRAM.

ENDIF.

ENDMODULE. " EXIT INPUT