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: 

Urgent Please

Former Member
0 Kudos

Hello SDN's,

Doubt : 1 I have a requirement where in i need to place a button in the table control of a customised screen. when ever user clicks the screen, i should go to a screen similar like SO10, where user keys in some texts in multiple lines.

How to achieve this?

And how should i save the texts entered by the user? i have a Z table which has a field long text, so my question is how to save the texts entered by the user into my Z Table.

Please go through IW32 - > Operations Tab - > LT. the LT is a button which leads to text editor.

Doubt 2 : i have a empty table control, how do i save the entered data into a ztable and i shud not allow the user to enter values in rows which are already being entered.

Please help.. its very very urgent

Rewards for sure.

Pratyusha.

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

For LONGTEXT try using the function module EDIT_TEXT.

DATA : header LIKE thead.

DATA : BEGIN OF lines OCCURS 0,

lines LIKE tline,

END OF lines.

  • AT USER COMMAND WRITE THIS CODE. just design a simple screen with a button on it and try this.

CASE sy-ucomm.

WHEN 'LT'.

header-tdobject = 'BOM'.

header-tdid = 'DKO'.

header-tdspras = 'EN'.

header-tdlinesize = 100.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

header = header

TABLES

lines = lines.

IF sy-subrc <> 0.

ENDIF.

ENDCASE.

Regards

Gopi

Message was edited by: Gopi Narendra

9 REPLIES 9

former_member404244
Active Contributor
0 Kudos

Hi Pratyusha,

create a screen with one push button.The first screen number is 1001 and second screen number is 1002.Then write the logic in the PAI of that screen.

case sy-ucomm.

when 'PB'.

leave to screen 1002.

endcase.

Now when u click on push button it will take u next screen.Now design ur second screen like SO10.

Inorder to save the zfield then u need to write the logic in PAI and under sy-ucomm 'SAVE'.

Regards,

Nagaraj

gopi_narendra
Active Contributor
0 Kudos

For LONGTEXT try using the function module EDIT_TEXT.

DATA : header LIKE thead.

DATA : BEGIN OF lines OCCURS 0,

lines LIKE tline,

END OF lines.

  • AT USER COMMAND WRITE THIS CODE. just design a simple screen with a button on it and try this.

CASE sy-ucomm.

WHEN 'LT'.

header-tdobject = 'BOM'.

header-tdid = 'DKO'.

header-tdspras = 'EN'.

header-tdlinesize = 100.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

header = header

TABLES

lines = lines.

IF sy-subrc <> 0.

ENDIF.

ENDCASE.

Regards

Gopi

Message was edited by: Gopi Narendra

former_member404244
Active Contributor
0 Kudos

Hi Pratyusha,

For the second doubt.

In the table control attributes give the column to be fixed.

regards,

Nagaraj

0 Kudos

Hi Nagraj,

Thanks for the reply.

for doubt 1 u did not understood me, just see IW32 - > Operations Tab - > LT Column. the LT which is seen there is a Button. so if u press that button you will come to know.

My 2nd doubt was i shud nt be able to enter multiple entries in the table control.

for Ex:

Line no LT Qty Unit Price Curr

10 BUTTON 10 EA 100 INR

So when in enter values in 2nd row i should not be able to enter 10.

these values whihc i enter am supposed to store in a Ztable.

Please help.

Pratyusha

former_member758419
Active Participant
0 Kudos

Hi usha,

Doubt 1: Using okcode or sy-ucomm check for the event in push button then in code,,,

case sy-ucomm.

when 'SO10'.

SET SCREEN '0010'. 'Screen similar to so10

LEAVE SCREEN.

END CASE

END MODULE.

IN Module '0010'

you will be having push button to enter the field text to ztable.

case sy-ucomm.

when 'lt'.

INSERT ztable.

if sy-subrc eq 0.

message

endif.

endcase.

end module.

former_member404244
Active Contributor
0 Kudos

Hi Pratyusha,

for the second doubt,if iam not wrong ur ztable should hv some key(primary).See i have three fields matnr,mtart,werks.I have made matnr as primary key.

in the PAI event

loop the table control(itab).

now create the pai module and write.

case sy-ucomm.

when 'SAVE'.

SELECT matnr werks mtart from ztable

where matnr = itab-matnr.

if sy-subrc eq 0.

throw error message saying entry already exists.

else.

insert ztable.

endif.

endloop.

try like this.

Regards,

nagaraj

0 Kudos

Hi SDN,

Urgent Please....HELP

Rewards for <b>SURE</b>

0 Kudos

For your second pt related to error msg on duplicate line no.

In the module to validate lineno.

you can just check the internal table where you store the item level data..for the particular lineno..

If the count is more than one you should show an error message.

0 Kudos

Hi Usha,

Please let me know how you have implemented this.

nvreddi@gmail.com

Thanks