2014 Apr 29 12:32 PM
Hello.
I have this code:
PARAMETERS: p_ort01 TYPE ort01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ort01.
DATA: BEGIN OF table OCCURS 0,
MTEXT type MTEXT_D,
ORT01 type ORT01,
MWAER type MWAER,
END OF table.
DATA: lt_field_tab TYPE STANDARD TABLE OF dfies.
DATA: lw_field_tab TYPE dfies.
SELECT MTEXT ORT01 MWAER
INTO TABLE table
FROM t000.
lw_field_tab-tabname = 'T000'.
lw_field_tab-fieldname = 'MTEXT'.
APPEND lw_field_tab TO lt_field_tab.
lw_field_tab-fieldname = 'ORT01'.
APPEND lw_field_tab TO lt_field_tab.
lw_field_tab-fieldname = 'MWAER'.
APPEND lw_field_tab TO lt_field_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORT01'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_ORT01'
window_title = 'Search'
value_org = 'S'
TABLES
value_tab = table
field_tab = lt_field_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
And the result is that the cols aren't "associate" with the fields, each row from "TABLE" is treated like a single string, and is splitted in the cols:
When it should be like this:
The content of table "TABLE" is correct:
The first 3 characters are lost, maybe due to MANDT has 3 characters and is before than MTEXT.
If I set the parameter "value_org" to default value, the result is that only the field MTEXT from each row is showed:
Select MANDT or all of fields from T000 is not a possible solution.
What am I doing wrong? Thanks.
2014 Apr 29 12:42 PM
Hi...
I make some changes in ur code ...as shown below
so do this way.....no need to append those to other internal table and in tables parameter dont use that field_tab = lt_field_tab.
*&---------------------------------------------------------------------*
*& Report YVAMC_DOUBT1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT YVAMC_DOUBT1.
PARAMETERS: p_ort01 TYPE ort01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ort01.
DATA: BEGIN OF table OCCURS 0,
MTEXT type MTEXT_D,
ORT01 type ORT01,
MWAER type MWAER,
END OF table.
DATA: lt_field_tab TYPE STANDARD TABLE OF dfies.
DATA: lw_field_tab TYPE dfies.
SELECT MTEXT ORT01 MWAER
INTO TABLE table
FROM t000.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORT01'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_ORT01'
window_title = 'Search'
value_org = 'S'
TABLES
value_tab = table
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Output is like this.....
Hello.
I have this code:
PARAMETERS: p_ort01 TYPE ort01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ort01.
DATA: BEGIN OF table OCCURS 0,
MTEXT type MTEXT_D,
ORT01 type ORT01,
MWAER type MWAER,
END OF table.
DATA: lt_field_tab TYPE STANDARD TABLE OF dfies.
DATA: lw_field_tab TYPE dfies.
SELECT MTEXT ORT01 MWAER
INTO TABLE table
FROM t000.
lw_field_tab-tabname = 'T000'.
lw_field_tab-fieldname = 'MTEXT'.
APPEND lw_field_tab TO lt_field_tab.
lw_field_tab-fieldname = 'ORT01'.
APPEND lw_field_tab TO lt_field_tab.
lw_field_tab-fieldname = 'MWAER'.
APPEND lw_field_tab TO lt_field_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORT01'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_ORT01'
window_title = 'Search'
value_org = 'S'
TABLES
value_tab = table
field_tab = lt_field_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
And the result is that the cols aren't "associate" with the fields, each row from "TABLE" is treated like a single string, and is splitted in the cols:
When it should be like this:
The content of table "TABLE" is correct:
The first 3 characters are lost, maybe due to MANDT has 3 characters and is before than MTEXT.
If I set the parameter "value_org" to default value, the result is that only the field MTEXT from each row is showed:
Select MANDT or all of fields from T000 is not a possible solution.
What am I doing wrong? Thanks.
2014 Apr 29 12:42 PM
Hi...
I make some changes in ur code ...as shown below
so do this way.....no need to append those to other internal table and in tables parameter dont use that field_tab = lt_field_tab.
*&---------------------------------------------------------------------*
*& Report YVAMC_DOUBT1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT YVAMC_DOUBT1.
PARAMETERS: p_ort01 TYPE ort01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ort01.
DATA: BEGIN OF table OCCURS 0,
MTEXT type MTEXT_D,
ORT01 type ORT01,
MWAER type MWAER,
END OF table.
DATA: lt_field_tab TYPE STANDARD TABLE OF dfies.
DATA: lw_field_tab TYPE dfies.
SELECT MTEXT ORT01 MWAER
INTO TABLE table
FROM t000.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORT01'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_ORT01'
window_title = 'Search'
value_org = 'S'
TABLES
value_tab = table
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Output is like this.....
2014 Apr 29 12:47 PM
2014 Apr 29 12:46 PM
Hi Adrian,
Only pass
TABLES
value_tab = table
No need of field_tab = lt_field_tab.
I checked with your code, only omitted field_tab. I got the below:
Thanks,
Anubhab