11-05-2006 1:22 PM
Hellow I wont 2 assign value into itab from wa_itab but the values is enter in the wrong field see
SELECT SINGLE objid
FROM hrp1000
INTO wa_d_itab-objid
WHERE otype = 'S'
AND objid = wa_itab-plans
AND begda <= currnt_date
AND endda >= currnt_date.
IF sy-subrc <> 0.
<b>wa_error_itab-description = 'plans problem'.
APPEND wa_error_itab-description TO error_itab.
APPEND wa_itab-plans TO error_itab.</b>
ENDIF.
This is the line that I have a problem
wa_error_itab-description = 'plans problem'.
APPEND wa_error_itab-description TO error_itab.
The value description isnt inhabitant in my internal table in the place that it should be.
thankes
11-05-2006 1:35 PM
hi,
the way you populate the internal table is not correct it seems.
if WA_ERROR_ITAB is the work area of ERROR_ITAB, you can use the following logic.
IF SY-SUBRC <> 0.
WA_ERROR_ITAB-description = 'Plans Problem'.
WA_ERROR_ITAB-plans = WA_ITAB-PLANS .
APPEND WA_ERROR_ITAB TO ERROR_TAB.
ENDIF.
Hope this works.
Sajan.
11-05-2006 1:38 PM
sh tal,
is it possible that your internal table error_itab has not the same strucure as the work area wa_error_itab?
Tell us what you expect in detail and what is the actual result in detail. You did not post the declaration (dada statement) for wa_error_itab and error_itab. So it is hard to guess what gies wrong.
Regards,
Clemens
11-06-2006 2:40 AM
HI
Please try this way:
IF sy-subrc <> 0.
<b>*wa_error_itab-description = 'plans problem'.
*APPEND wa_error_itab-description TO error_itab.
*APPEND wa_itab-plans TO error_itab.
concantenate 'Plans Problem:' wa_itab-plans into wa_error_itab-description separated by space.
append wa_error_itab to error_itab.</b>
ENDIF.
If you still have the problem, kindly post the definitions of error_itab, wa_error_itab, wa_itab for better advices.
Kind Regards
Eswar
11-06-2006 4:49 AM
hi
good
take this example and use accordingly
TYPES: BEGIN OF COMPANIES_TYPE,
NAME(10), SALES TYPE I,
END OF COMPANIES_TYPE.
DATA COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE
INITIAL SIZE 3,
WA_COMPANIES TYPE COMPANIES_TYPE.
WA_COMPANIES-NAME = 'big'.
WA_COMPANIES-SALES = 90.
APPEND WA_COMPANIES TO COMPANIES.
WA_COMPANIES-NAME = 'small'.
WA_COMPANIES-SALES = 10.
APPEND WA_COMPANIES TO COMPANIES.
WA_COMPANIES-NAME = 'too small'.
WA_COMPANIES-SALES = 5.
APPEND WA_COMPANIES TO COMPANIES.
WA_COMPANIES-NAME = 'middle'.
WA_COMPANIES-SALES = 50.
APPEND WA_COMPANIES TO COMPANIES SORTED BY SALES.
thanks
mrutyun^