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: 

how to write select statement

former_member1242340
Participant
0 Kudos

HI,

I am adding an additional tab in Plant maintenance Notification, which is called as Y-Y Analysis,

actually what it does is in notification when we enter an activity for that particular activity it will analyzes the activity

in deep. My problem is its working for only single activity when i select second in activities and click yy analysis its not showing the selected instead of that its showing previous(1st activity) activity.

my code where the values are

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = e_viqmma-mngrp

and code = e_viqmma-mncod

and sprache = sy-langu.

if text_i_4 is initial.

text_i_4 = e_viqmma-matxt.

endif.

if ( cust_aktyp = 'V' or cust_aktyp = 'A' ) and text_i_4 is initial.

"Notifn Change/Display

select single * from qmma into viqmma

where qmnum = viqmel-QMNUM and kzloesch = ''.

&----


  • loop at t_tc.

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = viqmma-mngrp

and code = viqmma-mncod

and sprache = sy-langu.

from here this select statements its collecting the the values of activity tab,

my requirement is it must show what ever i select in activity tab it should display in yy analysis Tab

Thanks in Advance

Rajesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi rajesh,

check u r select query.

U have written like this,

select single * from qmma into viqmma " here u copied all data in viqmma table

where qmnum = viqmel-QMNUM and kzloesch = ''.

&----


  • loop at t_tc. "here u r giving loop for t_tc table

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = viqmma-mngrp

and code = viqmma-mncod

and sprache = sy-langu. " in this select query u have only written that codegruppe = viqmma-mngrp and code = viqmma-mncod.

Here u have to write "for all entries in viqmma" if u have written like this then put the break point on above select query and chek the value is coming in your where condition field (viqmma-mngrp)

if u have any doubt revert back.

Best Regards,

Sanket.

8 REPLIES 8

Former Member
0 Kudos

Hi rajesh,

check u r select query.

U have written like this,

select single * from qmma into viqmma " here u copied all data in viqmma table

where qmnum = viqmel-QMNUM and kzloesch = ''.

&----


  • loop at t_tc. "here u r giving loop for t_tc table

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = viqmma-mngrp

and code = viqmma-mncod

and sprache = sy-langu. " in this select query u have only written that codegruppe = viqmma-mngrp and code = viqmma-mncod.

Here u have to write "for all entries in viqmma" if u have written like this then put the break point on above select query and chek the value is coming in your where condition field (viqmma-mngrp)

if u have any doubt revert back.

Best Regards,

Sanket.

0 Kudos

Hey Thanks For your Reply

Can you correct the code send it back to me

i am unable to get it exactly,

in that loop is commented should i write loop to this condition

Former Member
0 Kudos

Hi,

Pls try like this

select * from qpct into text_i_4

for all entries in viqmma

where codegruppe = viqmma-mngrp

and code = viqmma-mncod

and katalogart = 'A'

and sprache = sy-langu.

Regards,

Gowri Sankar

Edited by: Gowri Sankar Dinakaran on Sep 5, 2008 1:44 PM

0 Kudos

Hi,

Just try above select query given by gowri shankar.

instead of loop try for all entries in .....

Regards,

Sanket

0 Kudos

I tried the above Select Statement but here its giving an error called as

:VIQMMA" is not an internal table table- the "OCCURS n" Specification is Missing.

Please solve this problem ill be more thank full to you guys

shall i send all the code wriitten in that include.

0 Kudos

this the entire where my additional screen works please help me solve the problem

&----


*& Module STATUS_0101 OUTPUT

&----


  • text

----


module status_0101 output.

    • SET PF-STATUS 'xxxxxxxx'.

    • SET TITLEBAR 'xxx'.

endmodule. " STATUS_0101 OUTPUT

----


***INCLUDE ZXQQMO02 .

----


&----


*& Module STATUS_0102 OUTPUT

&----


  • text

----


MODULE STATUS_0102 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

*Commented on 31.07.2008

clear flag_error.

text_i_1 = ' Question'.

text_i_2 = ' Answer'.

text_i_3 = 'What is your final action, so that it is OK ?'.

text_i_6 = ' Why'.

text_i_7 = ' Answer'.

text_i_8 = ' Action'.

text_i_10 = 'Why do you take the above action?'.

text_i_11 = ' Due To'.

text_i_12 = ' Action Needed'.

data : e_viqmma like viqmma OCCURS 0 WITH HEADER LINE.

  • data : t_viqmma like viqmma OCCURS 0 WITH HEADER LINE.

  • DATA : wa_viqmma like t_viqmma.

import e_viqmma from memory id 'Y_VIQMMA'.

*loop at t_why_dtls into wa_ympmt_why_dtls.

  • loop at t_tc.

  • Loop at T_viqmma into wa_viqmma.

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = e_viqmma-mngrp

and code = e_viqmma-mncod

and sprache = sy-langu.

if text_i_4 is initial.

text_i_4 = e_viqmma-matxt.

endif.

if ( cust_aktyp = 'V' or cust_aktyp = 'A' ) and text_i_4 is initial.

"Notifn Change/Display

select single * from qmma into viqmma

where qmnum = viqmel-QMNUM and kzloesch = ''.

&----


  • loop at t_tc.

  • select single kurztext from qpct into text_i_4

  • where katalogart = 'A'

  • and codegruppe = viqmma-mngrp

  • and code = viqmma-mncod

  • and sprache = sy-langu .

select * from qpct into text_i_4

for all entries in viqmma

where codegruppe = viqmma-mngrp

and code = viqmma-mncod

and katalogart = 'A'

and sprache = sy-langu.

  • endselect.

&----


if sy-subrc = 0.

else.

text_i_4 = viqmma-matxt.

endif.

endif.

if text_i_4 is initial.

message w537(im).

flag_error = 'X'.

  • exit.

elseif not t_tc[] is initial.

clear t_tc.

concatenate 'Why' text_i_4 into t_tc-why_quest separated by space.

modify t_tc index 1 transporting why_quest.

endif.

  • if act_code_text is initial.

  • import act_text from memory id 'YACT_TEXT'.

  • if not act_text is initial.

  • text_i_4 = act_text.

  • endif.

  • else.

  • text_i_4 = act_code_text.

  • endif.

  • endloop.

text_i_14 = ' Root Cause'.

text_i_15 = ' JH'.

text_i_16 = ' PM'.

text_i_17 = ' Design'.

text_i_18 = ' E & T'.

**Commented on 31.07.2008

ENDMODULE. " STATUS_0102 OUTPUT

&----


*& Module CODE_PF4_I15 INPUT

&----


  • PF4 Worth help to code group and code selection on all screen

  • for problem, object part, cause, measure and action

----


module code_pf4_i15 input.

*Commented on 31.07.2008

perform code_pf4_f40(sapliqs0).

*Commented on 31.07.2008

endmodule. " CODE_PF4_I15 INPUT

&----


*& Module get_data_tc1 OUTPUT

&----


  • text

----


MODULE get_data_tc1 OUTPUT.

*Commented on 31.07.2008

clear : t_tc, t_index.

t_index = tc1-top_line + sy-stepl - 1.

read table t_tc index t_index.

if sy-subrc ne 0 and t_index ne 1.

loop at screen.

screen-input = '0'.

screen-output = '1'.

modify screen.

endloop.

elseif cust_aktyp = 'A' or flag_error = 'X'.

loop at screen.

screen-input = '0'.

screen-output = '1'.

modify screen.

endloop.

endif.

if t_tc-why_text is initial.

clear char2.

char2 = t_index.

concatenate 'Why' char2 into text_i_13.

else.

text_i_13 = t_tc-why_text.

endif.

why_question = t_tc-why_quest.

riwo00-txtcdur = t_tc-cause_code.

cause_text = t_tc-cause_text.

riwo00-txtcdma = t_tc-actvt_code.

actvt_text = t_tc-actvt_text.

*Commented on 31.07.2008

ENDMODULE. " get_data_tc1 OUTPUT

&----


*& Module get_data_tc2 OUTPUT

&----


  • text

----


MODULE get_data_tc2 OUTPUT.

*Commented on 31.07.2008

clear t_index.

t_index = tc2-top_line + sy-stepl - 1.

read table t_tc2 index t_index.

if sy-subrc ne 0 and t_index ne 1.

loop at screen.

screen-input = '0'.

screen-output = '1'.

modify screen.

endloop.

elseif cust_aktyp = 'A' or flag_error = 'X'.

loop at screen.

screen-input = '0'.

screen-output = '1'.

modify screen.

endloop.

endif.

root_cause = t_tc2-root_cause.

jh = t_tc2-jh.

pm = t_tc2-pm.

design = t_tc2-design.

e_n_t = t_tc2-e_n_t.

*Commented on 31.07.2008

ENDMODULE. " get_data_tc2 OUTPUT

&----


*& Module get_tc1 OUTPUT

&----


  • text

----


MODULE get_tc1 OUTPUT.

*Commented on 31.07.2008

tc1-lines = 3.

  • tc1-top_line = 1.

check flag_error is initial.

  • H-Create Notification, V-Change Notification, A-Display Notification

clear t_tc.

read table t_tc index 1.

if sy-subrc ne 0.

clear wa_ympmt_why_dtls.

if cust_aktyp = 'H'. "Notification Creation

clear t_tc.

concatenate 'Why' text_i_4 into t_tc-why_quest separated by

space.

append t_tc.

elseif cust_aktyp = 'V' or cust_aktyp = 'A'. "Notifn Change/Display

*******************************************************************

  • select single * from qmma into viqmma

  • where qmnum = viqmel-qmnum.

  • if text_i_4 is initial.

  • select single kurztext from qpct into text_i_4

  • where katalogart = 'A'

  • and codegruppe = viqmma-mngrp

  • and code = viqmma-mncod

  • and sprache = sy-langu.

  • endif.

*********************************************************************

select single * from ympmt_why_dtls into wa_ympmt_why_dtls

where qmnum = viqmel-qmnum.

concatenate 'Why' text_i_4 into t_tc-why_quest

separated by space.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_1.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_1.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_1.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_1.

append t_tc.

check not wa_ympmt_why_dtls-yy_due_cct_1 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_1 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_2 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_2 is initial or

not wa_ympmt_why_dtls-yy_action_act_2 is initial or

not wa_ympmt_why_dtls-yy_action_txt_2 is initial.

clear t_tc.

if not wa_ympmt_why_dtls-yy_due_cct_1 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_1

into t_tc-why_quest separated by space.

elseif not not wa_ympmt_why_dtls-yy_due_cct_tx_1 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_1

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_2.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_2.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_2.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_2.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_2 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_2 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_2 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_2 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_3 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_3 is initial or

not wa_ympmt_why_dtls-yy_action_act_3 is initial or

not wa_ympmt_why_dtls-yy_action_txt_3 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_2 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_2

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_2 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_2

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_2 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_2

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_2 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_2

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_3.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_3.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_3.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_3.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_3 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_3 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_3 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_3 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_4 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_4 is initial or

not wa_ympmt_why_dtls-yy_action_act_4 is initial or

not wa_ympmt_why_dtls-yy_action_txt_4 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_3 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_3

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_3 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_3

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_3 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_3

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_3 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_3

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_4.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_4.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_4.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_4.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_4 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_4 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_4 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_4 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_5 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_5 is initial or

not wa_ympmt_why_dtls-yy_action_act_5 is initial or

not wa_ympmt_why_dtls-yy_action_txt_5 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_4 is initial.

  • concatenate 'Why' wa_ympmt_w y_dtls-yy_action_act_4

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_4 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_4

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_4 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_4

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_4 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_4

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_5.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_5.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_5.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_5.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_5 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_5 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_5 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_5 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_6 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_6 is initial or

not wa_ympmt_why_dtls-yy_action_act_6 is initial or

not wa_ympmt_why_dtls-yy_action_txt_6 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_5 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_5

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_5 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_5

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_5 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_5

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_5 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_5

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_6.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_6.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_6.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_6.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_6 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_6 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_6 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_6 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_7 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_7 is initial or

not wa_ympmt_why_dtls-yy_action_act_7 is initial or

not wa_ympmt_why_dtls-yy_action_txt_7 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_6 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_6

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_6 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_6

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_6 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_6

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_6 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_6

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_7.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_7.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_7.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_7.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_7 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt 7 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_7 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_7 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_8 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_8 is initial or

not wa_ympmt_why_dtls-yy_action_act_8 is initial or

not wa_ympmt_why_dtls-yy_action_txt_8 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_7 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_7

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_7 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_7

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_7 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_7

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_7 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_7

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_8.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_8.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_8.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_8.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_8 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_8 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_8 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_8 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_9 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_9 is initial or

not wa_ympmt_why_dtls-yy_action_act_9 is initial or

not wa_ympmt_why_dtls-yy_action_txt_9 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_8 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_8

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_8 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_8

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_8 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_8

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_8 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_8

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_9.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_9.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_9.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_9.

append t_tc.

  • check not wa_ympmt_why_dtls-yy_action_act_9 is initial or

  • not wa_ympmt_why_dtls-yy_action_txt_9 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_9 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_9 is initial.

check not wa_ympmt_why_dtls-yy_due_cct_10 is initial or

not wa_ympmt_why_dtls-yy_due_cct_tx_10 is initial or

not wa_ympmt_why_dtls-yy_action_act_10 is initial or

not wa_ympmt_why_dtls-yy_action_txt_10 is initial.

clear t_tc.

  • if not wa_ympmt_why_dtls-yy_action_act_9 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_act_9

  • into t_tc-why_quest separated by space.

  • elseif not wa_ympmt_why_dtls-yy_action_txt_9 is initial.

  • concatenate 'Why' wa_ympmt_why_dtls-yy_action_txt_9

  • into t_tc-why_quest separated by space.

  • endif.

if not wa_ympmt_why_dtls-yy_due_cct_9 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_9

into t_tc-why_quest separated by space.

elseif not wa_ympmt_why_dtls-yy_due_cct_tx_9 is initial.

concatenate 'Why' wa_ympmt_why_dtls-yy_due_cct_tx_9

into t_tc-why_quest separated by space.

endif.

t_tc-cause_code = wa_ympmt_why_dtls-yy_due_cct_10.

t_tc-cause_text = wa_ympmt_why_dtls-yy_due_cct_tx_10.

t_tc-actvt_code = wa_ympmt_why_dtls-yy_action_act_10.

t_tc-actvt_text = wa_ympmt_why_dtls-yy_action_txt_10.

append t_tc.

endif.

endif.

ENDMODULE. " get_tc1 OUTPUT

&----


*& Module get_tc2 OUTPUT

&----


  • text

----


MODULE get_tc2 OUTPUT.

tc2-top_line = 1.

if t_tc2[] is initial.

clear t_tc2.

t_tc2-root_cause = '1. Poor Basic Condition'.

t_tc2-jh = wa_ympmt_why_dtls-yy_pbc_jh.

t_tc2-pm = wa_ympmt_why_dtls-yy_pbc_pm.

t_tc2-design = wa_ympmt_why_dtls-yy_pbc_design.

t_tc2-e_n_t = wa_ympmt_why_dtls-yy_pbc_e_n_t.

append t_tc2.

t_tc2-root_cause = '2. Poor Operating Condition'.

t_tc2-jh = wa_ympmt_why_dtls-yy_poc_jh.

t_tc2-pm = wa_ympmt_why_dtls-yy_poc_pm.

t_tc2-design = wa_ympmt_why_dtls-yy_poc_design.

t_tc2-e_n_t = wa_ympmt_why_dtls-yy_poc_e_n_t.

append t_tc2.

t_tc2-root_cause = '3. Leaving Deterioration Unattended'.

t_tc2-jh = wa_ympmt_why_dtls-yy_ldu_jh.

t_tc2-pm = wa_ympmt_why_dtls-yy_ldu_pm.

t_tc2-design = wa_ympmt_why_dtls-yy_ldu_design.

t_tc2-e_n_t = wa_ympmt_why_dtls-yy_ldu_e_n_t.

append t_tc2.

t_tc2-root_cause = '4. Weak Design'.

t_tc2-jh = wa_ympmt_why_dtls-yy_wd_jh.

t_tc2-pm = wa_ympmt_why_dtls-yy_wd_pm.

t_tc2-design = wa_ympmt_why_dtls-yy_wd_design.

t_tc2-e_n_t = wa_ympmt_why_dtls-yy_wd_e_n_t.

append t_tc2.

t_tc2-root_cause = '5. Poor Skill'.

t_tc2-jh = wa_ympmt_why_dtls-yy_ps_jh.

t_tc2-pm = wa_ympmt_why_dtls-yy_ps_pm.

t_tc2-design = wa_ympmt_why_dtls-yy_ps_design.

t_tc2-e_n_t = wa_ympmt_why_dtls-yy_ps_e_n_t.

append t_tc2.

endif.

ENDMODULE.

Former Member
0 Kudos

Hi,

MODULE STATUS_0102 OUTPUT.

SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'xxx'.

*Commented on 31.07.2008

clear flag_error.

text_i_1 = ' Question'.

text_i_2 = ' Answer'.

text_i_3 = 'What is your final action, so that it is OK ?'.

text_i_6 = ' Why'.

text_i_7 = ' Answer'.

text_i_8 = ' Action'.

text_i_10 = 'Why do you take the above action?'.

text_i_11 = ' Due To'.

text_i_12 = ' Action Needed'.

data : e_viqmma like viqmma OCCURS 0 WITH HEADER LINE.

data : t_viqmma like viqmma OCCURS 0 WITH HEADER LINE.

data : lt_viqmma litk viqmma OCCURS 0 WITH HEADER LINE.

DATA : wa_viqmma like t_viqmma.

import e_viqmma from memory id 'Y_VIQMMA'.

*loop at t_why_dtls into wa_ympmt_why_dtls.

loop at t_tc.

Loop at T_viqmma into wa_viqmma.

select single kurztext from qpct into text_i_4

where katalogart = 'A'

and codegruppe = e_viqmma-mngrp

and code = e_viqmma-mncod

and sprache = sy-langu.

if text_i_4 is initial.

text_i_4 = e_viqmma-matxt.

endif.

if ( cust_aktyp = 'V' or cust_aktyp = 'A' ) and text_i_4 is initial.

"Notifn Change/Display

*select single * from qmma into lt_viqmma*

where qmnum = viqmel-QMNUM and kzloesch = ''.

&----


*select * from qpct into text_i_4*

for all entries in lt_viqmma

where codegruppe = lt_viqmma-mngrp

and code = lt_viqmma-mncod

and katalogart = 'A'

and sprache = sy-langu.

endselect.

&----


if sy-subrc = 0.

else.

text_i_4 = viqmma-matxt.

endif.

endif.

if text_i_4 is initial.

message w537(im).

flag_error = 'X'.

exit.

elseif not t_tc[] is initial.

clear t_tc.

concatenate 'Why' text_i_4 into t_tc-why_quest separated by space.

modify t_tc index 1 transporting why_quest.

endif.

if act_code_text is initial.

import act_text from memory id 'YACT_TEXT'.

if not act_text is initial.

text_i_4 = act_text.

endif.

else.

text_i_4 = act_code_text.

endif.

endloop.

text_i_14 = ' Root Cause'.

text_i_15 = ' JH'.

text_i_16 = ' PM'.

text_i_17 = ' Design'.

text_i_18 = ' E & T'.

**Commented on 31.07.2008

ENDMODULE. " STATUS_0102 OUTPUT

0 Kudos

Sorry guys the above code is not working,

can you please suggest any other solution