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

Service entry sheet for t.code ml81n

Former Member
0 Likes
676

Hai every one,

My requirement is like this.

User should select one line item while adopting from service PO in service entry sheet and save. So that he will get one service entry sheet for one line item. so when he select more than one line item and tries to save in one service entry sheet the system should give error message and he should not be able to save.

For this i found one function exit 'EXIT_SAPLMLSP_031'.

i wrote the code like this.

*BREAK-POINT.

tables:esll, rm11p.

data : serent like esll-extrow,

serent1 like esll-introw,

count type i

.

data: begin of ix_esll occurs 2000.

include structure msupdap.

data: selkz like rm11p-selkz.

data: end of ix_esll.

*break-point.

*count = 0.

**loop at IX_ESLL .

*if IX_ESLL-selkz = 'X'.

*count = count + 1.

*endif.

*endloop.

break-point.

if sy-tcode = 'ML81N'.

*if sy-index <> 0.

if sy-srows <> 0.

  • esll-extrow <> '0000000010'.

*if esll-EXTROW = '0000000010'.

*if ix_esll-extrow <> '0000000010'.

message e000(38) with 'Select only one line item'.

endif.

endif.

*ENDIF.

In ML81n we can see the line item start with 10,20 ,30 like that. If i hard code the line number is 10. it will work correctly. if i select the 20 it wont work.

If user select 30 or 40 how i can do this.

Plz helpme regarding this. It is very urgent.

Thanks and Regards,

Vamsi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
602

Hi,

Just use the following code as it is. If you are facing any problem please let me know.


data: w_no_of_records Type I.
CONSTANTS:
      c_pgmvariable(21)  value '(SAPLMLSP)REF_ESLL[]'.
*
DATA: BEGIN OF I_REF_ESLL OCCURS 200.
         INCLUDE STRUCTURE UESLL.
DATA:    KOT_PACKNO LIKE COMSRV-KOT_PACKNO,
         KOT_INTROW LIKE COMSRV-KOT_INTROW,
         CON_PACKNO LIKE COMSRV-CON_PACKNO,
         CON_INTROW LIKE COMSRV-CON_INTROW.
DATA: END OF I_REF_ESLL.
FIELD-SYMBOLS: <FC> Type ANY.
*
assign (c_pgmvariable) to <FC>.
I_REF_ESLL[] = <FC>.
*
DESCRIBE table I_REF_ESLL Lines w_no_of_records.
If w_no_of_records NE 0.
   message e000(38) with 'Select only one line item'.
Endif.
*
Regards
Raju Chitale

1 REPLY 1
Read only

Former Member
0 Likes
603

Hi,

Just use the following code as it is. If you are facing any problem please let me know.


data: w_no_of_records Type I.
CONSTANTS:
      c_pgmvariable(21)  value '(SAPLMLSP)REF_ESLL[]'.
*
DATA: BEGIN OF I_REF_ESLL OCCURS 200.
         INCLUDE STRUCTURE UESLL.
DATA:    KOT_PACKNO LIKE COMSRV-KOT_PACKNO,
         KOT_INTROW LIKE COMSRV-KOT_INTROW,
         CON_PACKNO LIKE COMSRV-CON_PACKNO,
         CON_INTROW LIKE COMSRV-CON_INTROW.
DATA: END OF I_REF_ESLL.
FIELD-SYMBOLS: <FC> Type ANY.
*
assign (c_pgmvariable) to <FC>.
I_REF_ESLL[] = <FC>.
*
DESCRIBE table I_REF_ESLL Lines w_no_of_records.
If w_no_of_records NE 0.
   message e000(38) with 'Select only one line item'.
Endif.
*
Regards
Raju Chitale