Error in Moving values to field symbols. - CX_SY_CONVERSION_NO_NUMBER
Hi Friends,
I have asigned the component 'ICON' to the field symbol . While i am adding the value to the field symbol it is going for Dump.
Erro Message :
Unable to interpret "@08\QGreen Light; Go; Okay@ " as a number.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
The program attempted to interpret the value "@08\QGreen Light; Go; Okay@ " as
a number, but
since the value contravenes the rules for correct number formats,
this was not possible.
Code :
ASSIGN COMPONENT 'ICON' OF STRUCTURE <line> TO <fs_icon>.
add wa_result-icon to <fs_icon>.
Please find the information and i waiting for your valuable anwers.
Thanks,
Shankara Narayan
HI,
What do you mean by adding the value?
Do you want to move the value of wa_result-icon to the field-symbols <fs_icon>.
use move statement or use '=' operator.
ADD will try to do an addition.
You cannot add character fields. It will surely give a dump.
Do as follows:-
Move wa_result-icon to <fs_icon>.
Regards,
Ankur Parab
Similar Messages
-
Changing screen feild values through field symbols
hi
I am working on SAPMF02D user exit, it requires validation of searchterm1 feild, I have successfully completed this part with the help of field symbols, but the problem i am facing is that, after performing validation checks, searchterm1 feild would be updated, this I am not able to do, so far I have done the following:
DATA: fld(30) VALUE '(SAPLSZA1)ADDR1_DATA-SORT1'.
FIELD-SYMBOLS: <f1> TYPE ANY .
* Assign screen field values to field symbol
ASSIGN (fld) TO <f1>.
* get the value from field symbol into our field
IF <f1> IS ASSIGNED.
acc1 = <f1>.
ENDIF.
.. *Perform validation and updation on 'acc1'
* get the updated values back into screen feild
<f1> = acc1.
now this last thing is not working for me,, and the data does not get updated in screen/database....
I have tried using ' comit work' statement , but no use,
I require help on this issue and its quite urgent.
Thank you all for your time.Thank you again for the reply,
I am sorry , I am not able to use to that FM either,, I just cannot understand the parameters it is taking and how to provide them.
I have already used the FM "DYNP_UPDATE_FIELDS" and "DYNP_UPDATE_FIELDS" , as:
<f1> = acc1.
scrfields-fieldname = 'ADDR1_DATA-SORT1'.
scrfields-fieldvalue = <f1>.
APPEND scrfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'SAPLSZA1'
dynumb = '0301'
TABLES
dynpfields = scrfields[]
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* UNDEFIND_ERROR = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
but it did not helped my cause either..
Any help would be highly appreciated,
thank you -
How to populate values of field symbols?
HI,
I need to pass values into a field-symbol (defined as a dynamic Work Area) and append the values later on into another field-symbol (defined as a dynamic Table) by inserting the work area to the table. The insert statement in the screen shot below is syntetically correct but when I uncomment
* <gw_itab>-tplnr = 'TPLNR'.
* <gw_itab>-pmsog = 'PMSOG'.
* <gw_itab>-k_pro = 'K_PRO'.
I get a syntax error. During debugging if I pass the values of the work area, they are properly appended into the table.
Could somebody show me the code on how to atain this programatically?
Thanks for your help
CarlFrom the short dump:
"<GT_ITAB> has line type "v" and the length 24, but the work area has line type "g" and the length 8".
The code you included in your first screenshot is not the code that it dumped on... Looking at the shortdump here's what you have.
lv_fieldname = '<GW_ITAB>-TPLNR'.
assign (lv_fieldname) to <gw_itab>.
<gw_itab> = 'TPLNR'.
insert <gw_itab> into table <gt_itab>.
This code doesn't make any sense...
What you're saying is:
<gw_itab> points to <gw_itab>-tplnr. So now it points to just a field of the structure, not the whole structure.... Then you say that field is set to 'TPLNR'. So you set the field of the original structure called TPLNR to be the string "TPLNR"...
If that's really what you're trying to do then try changing it to:
field-symbols: <field> type any.
lv_fieldname = '<GW_ITAB>-TPLNR'.
assign (lv_fieldname) to <field>.
<field> = 'TPLNR'.
insert <gw_itab> into table <gt_itab>. -
To Modify a field value with field symbols
we had a requirement like we are getting in a floating point value in a field of an IDoc segment like 12.327- .Here if we see that the negative sign is after the floating point value and if we try to insert this into a database then it will throw out an error.Before inserting the value we need to covert the incoming value in the form -12.327.
I used the field symbols inorder to get the values and to change them.
But iam not able to modify the internal table from the new value.
Here is my sample code.
DATA: IT_MBEW TYPE TABLE OF MBEW,
WA_MBEW TYPE MBEW,
IT_DFIES TYPE TABLE OF DFIES,
WA_DFIES TYPE DFIES,
IT_DD03L TYPE TABLE OF DD03L,
WA_DD03L TYPE DD03L,
L_FIELD TYPE VALUE,
WA_VALUE TYPE mbew,
L_MBEW TYPE DDOBJNAME VALUE 'MBEW'.
FIELD-SYMBOLS: <FS1> TYPE ANY.
FIELD-SYMBOLS: <FS3> TYPE ANY.
FIELD-SYMBOLS: <FS2> TYPE ANY.
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_MBEW
FROM MBEW WHERE MATNR = '000000000000100110'.
LOOP AT IT_MBEW INTO WA_MBEW.
WA_MBEW-SALK3 = - 354471.
MODIFY IT_MBEW FROM WA_MBEW.
ENDLOOP.
To call the FM inorder to get the fieldnames for MBEW table
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = L_MBEW
FIELDNAME = ' '
LANGU = SY-LANGU
LFIELDNAME = ' '
ALL_TYPES = ' '
GROUP_NAMES = ' '
UCLEN =
IMPORTING
X030L_WA =
DDOBJTYPE =
DFIES_WA =
LINES_DESCR =
TABLES
DFIES_TAB = IT_DFIES
FIXED_VALUES =
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SELECT TABNAME FIELDNAME DATATYPE POSITION INTO CORRESPONDING FIELDS OF TABLE
IT_DD03L FROM DD03L
WHERE TABNAME = 'MBEW'
AND DATATYPE = 'CURR'
ORDER BY POSITION ASCENDING.
*LOOP AT IT_MBEW INTO WA_MBEW.
LOOP AT IT_MBEW assigning <fs1>.
ASSIGN WA_MBEW TO <FS1>.
do.
LOOP AT IT_DD03L INTO WA_DD03L.
READ TABLE IT_DFIES INTO WA_DFIES WITH KEY FIELDNAME = WA_DD03L-FIELDNAME
DATATYPE = WA_DD03L-DATATYPE.
IF SY-SUBRC = 0.
ASSIGN WA_DFIES-FIELDNAME TO <FS2>.
ASSIGN COMPONENT SY-TABIX OF STRUCTURE <FS1> TO <FS3>.
MOVE <FS3> TO L_FIELD.
CONDENSE L_FIELD.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = L_FIELD.
IF SY-SUBRC = 0.
ASSIGN L_FIELD TO <FS3>.
MODIFY ITMBEW INDEX SY-TABIX FROM <FS3>._
ENDIF.
ENDIF.
ENDLOOP.
*enddo.
ENDLOOP.
The Modify statement is not working.....Plesae help me in this regard.
Thanks
SrinivasHello.
When you write,
LOOP AT it_mbew ASSIGNING <fs1>.
ENDLOOP.
you don't need to use statements:
ASSIGN WA_MBEW TO <FS1>
nor
MODIFY it_mbew
after that.
If you just write:
LOOP AT it_mbew ASSIGNING <fs1>.
<fs1>-field1 = 'A'.
<fs1>-field2 = 'B'.
ENDLOOP.
all records of it_mbew will have field1 = 'A' and field2 = 'B'.
The point is, statement LOOP assigning <fs1> will make the field symbol to became a pointer to the records of the internal table. So, if you change the field symbol, you are changing the internal table already.
Regards.
Valter Oliveira. -
Error Enter a value for field BP_GUID
I am using MDG 7.0
When I create a Request for "Create ERP Customer",
I then enter data including the sales Area Data and Company Code data
Then Submit
at the following approval step , Sales Area data and CC data is missing.
I get ERROR message "Enter a value for Field BP_GUID"
Please advise what Table or T-code am I missing values for .
Thanks for your assistance,hi,
See the attached screen shot.
Regards,
Tushar -
Assigning value to Field - Symbol ( which is type of internal table field )
Hi All,
I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
So i declared an internal table it_tab with this structure.
I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
For this i created field-symbol .
Here, t_deployment table will have the plants 1,2,3...and
t_devobject will have some records for these plants.
LOOP AT T_DEPLOYMENT.
clear w_count.
LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
ZADSTATUS = '10'.
w_count = w_count + 1.
ENDLOOP.
concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
assign var_bet_name to <bet_var_name>.
now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
at last what i need is it_tab-plant1 = w_count.
whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
I tried the following statement.
(<bet_var_name>) = w_count. But its not working.
Please let me know how i can get this.
Thanks in Advance.
Pavan.Hi pavan,
As ur requirement is creating a dynamic internal table,
try the following way,
remember the fieldcat should be of type LVC not SLIS.
BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
ex:-
loop at it_models INTO WA_MODELS.
LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
append ls_lvcfieldcat to lt_lvcfieldcat.
endloop.
DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = LT_LVCFIELDCAT
IMPORTING
EP_TABLE = DREF.
ASSIGN dref->* TO <TEMP_TAB>.
now basing on the fieldcatalog <temp_tab> is build.
NOW FILL <TEMP_TAB>.
WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
this statement will be very usefull.
i hope this will be help full.
pls reward the points if it helps u.
regards
Hyma -
Getting a runtime error in block alv that field symbol has been assigned
hi to all experts ,
im getting a runtime error that field symbol has not been assigned in functionmodule reuse_alv_block_list_display
i tried a lot to rectify the error ,im unable to do it thats i have posted here
*& Report ZHAI_ALV_BLOCK_LIST
REPORT ZHAI_ALV_BLOCK_LIST.
type-pools:slis.
tables:mara.
DATA:BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MBRSH LIKE MARA-MBRSH,
MATKL LIKE MARA-MATKL,
END OF IT_MARA.
data: begin of IT_DESC OCCURS 0,
MATNR like MAKT-MATNR,
MAKTX like MAKT-MAKTX,
end of IT_DESC.
data: begin of IT_MARD occurs 0,
MATNR like mard-matnr,
WERKS like mard-werks,
LGORT like mard-lgort,
LABST like mard-labst,
end of IT_MARD.
data: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV ,
WA_FCAT LIKE LINE OF IT_FCAT,
IT_FCAT1 type slis_t_fieldcat_alv,
WA_FCAT1 LIKE LINE OF IT_FCAT1,
IT_FCAT2 TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT2 LIKE LINE OF IT_FCAT2,
wa_layout type SLIS_LAYOUT_ALV,
it_event type SLIS_T_EVENT,
wa_event like line of it_event,
wa_layout like line of it_layout,
V_REPID LIKE SY-REPID.
select-options:so_matnr for mara-matnr.
start-of-selection.
perform f_select_data.
DEFINE ADD_CATALOGUE1.
WA_FCAT-COL_POS = &1.
WA_FCAT-fieldname = &2.
WA_fcat-tabname = &3.
wa_fcat-emphasize = &4.
wa_fcat-ref_tabname = &5.
APPEND WA_FCAT TO IT_FCAT.
END-OF-DEFINITION.
DEFINE ADD_CATALOGUE2.
WA_FCAT1-COL_POS = &1.
WA_FCAT1-fieldname = &2.
WA_fcat1-tabname = &3.
wa_fcat1-emphasize = &4.
wa_fcat1-ref_tabname = &5.
APPEND WA_FCAT1 TO IT_FCAT1.
END-OF-DEFINITION.
DEFINE ADD_CATALOGUE3.
WA_FCAT2-COL_POS = &1.
WA_FCAT2-fieldname = &2.
WA_fcat2-tabname = &3.
wa_fcat2-emphasize = &4.
wa_fcat2-ref_tabname = &5.
APPEND WA_FCAT2 TO IT_FCAT2.
END-OF-DEFINITION.
perform f_build_fcat.
*perform f_build_fcat1.
perform f_build_fcat2.
PERFORM F_BUILD_LAYOUT.
PERFORM F_BUILD_EVENTS.
PERFORM F_BLOC_DISPLAY.
*& Form f_select_data
FORM f_select_data .
select matnr
mbrsh
matkl
from mara into table it_mara where matnr
in so_matnr.
if it_mara[] is not initial.
select matnr
maktx
from makt
into table it_desc
for all entries in it_mara
where matnr eq it_mara-matnr.
endif.
if it_desc[] is not initial.
select matnr
werks
lgort
labst
from mard
into table it_mard
for all entries in it_desc
where matnr eq it_desc-matnr.
endif.
ENDFORM. " f_select_data
*& Form f_build_fcat
FORM f_build_fcat .
ADD_CATALOGUE2:
'1' 'MATNR' 'IT_MARA' 'C500' 'MARA',
'2' 'MBRSH' 'IT_MARA' 'C600' 'MARA',
'3' 'MATKL' 'IT_MARA' 'C300' 'MARA'.
ENDFORM. " f_build_fcat
**& Form f_build_fcat1
FORM f_build_fcat1 .
ADD_CATALOGUE1:
'1' 'MATNR' 'IT_DESC' 'C500' 'MAKT',
'2' 'MAKTX' 'IT_DESC' 'C600' 'MAKT'.
ENDFORM. " f_build_fcat1
*& Form f_build_fcat2
FORM f_build_fcat2.
ADD_CATALOGUE3:
'1' 'MATNR' 'IT_MARD' 'C500' 'MARD',
'2' 'WERKS' 'IT_MARD' 'C600' 'MARD',
'3' 'LGORT' 'IT_MARD' 'C200' 'MARD',
'4' 'LABST' 'IT_MARD' 'C300' 'MARD'.
ENDFORM. " f_build_fcat2
*& Form F_BLOC_DISPLAY
text
--> p1 text
<-- p2 text
FORM F_BLOC_DISPLAY .
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fcat
I_TABNAME = 'IT_MARA'
IT_EVENTS = it_event
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = wa_layout
IT_FIELDCAT = it_fcat1
I_TABNAME = 'IT_DESC'
IT_EVENTS = IT_EVENT
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_DESC
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = wa_LAYOUT
IT_FIELDCAT = IT_FCAT2
I_TABNAME = 'IT_MARD'
IT_EVENTS = IT_EVENT
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARD
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_BLOC_DISPLAY
*& Form F_BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM F_BUILD_LAYOUT .
wa_layout-edit = 'X'.
wa_layout-window_titlebar = 'MOHAMMED ABDUL HAI'.
wa_layout-zebra = 'X'.
ENDFORM. " F_BUILD_LAYOUT
*& Form F_BUILD_EVENTS
text
--> p1 text
<-- p2 text
FORM F_BUILD_EVENTS .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IT_EVENT
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT IT_EVENT BY NAME.
READ TABLE it_event INTO wa_event WITH KEY NAME = 'TOP_OF_PAGE' bINARY
SEArch.
if sy-subrc eq 0.
wa_event-form = 'F_TOP_OF_PAGE'.
ENDIF.
MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX TRANSPORTING FORM.
READ TABLE IT_EVENT INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
WA_EVENT-FORM = 'F_USER_COMMAND'.
MODIFY IT_EVENT FROM wa_event INDEX SY-TABIX TRANSPORTING FORM.
ENDFORM. " F_BUILD_EVENTSHi,
When does this runtime error occur? When displaying output (calling FM) or.....
I copied your coding and made a few minor changes and It's working fine for my now:
REPORT ZHAI_ALV_BLOCK_LIST.
TYPE-POOLS:slis.
TABLES:mara.
DATA:BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
mbrsh LIKE mara-mbrsh,
matkl LIKE mara-matkl,
END OF it_mara.
DATA: BEGIN OF it_desc OCCURS 0,
matnr LIKE makt-matnr,
maktx LIKE makt-maktx,
END OF it_desc.
DATA: BEGIN OF it_mard OCCURS 0,
matnr LIKE mard-matnr,
werks LIKE mard-werks,
lgort LIKE mard-lgort,
labst LIKE mard-labst,
END OF it_mard.
DATA: it_fcat TYPE slis_t_fieldcat_alv ,
wa_fcat LIKE LINE OF it_fcat,
it_fcat1 TYPE slis_t_fieldcat_alv,
wa_fcat1 LIKE LINE OF it_fcat1,
it_fcat2 TYPE slis_t_fieldcat_alv,
wa_fcat2 LIKE LINE OF it_fcat2,
wa_layout TYPE slis_layout_alv,
it_event TYPE slis_t_event,
wa_event LIKE LINE OF it_event,
* wa_layout like line of it_layout,
v_repid LIKE sy-repid.
SELECT-OPTIONS:so_matnr FOR mara-matnr.
START-OF-SELECTION.
PERFORM f_select_data.
DEFINE add_catalogue1.
wa_fcat-col_pos = &1.
wa_fcat-fieldname = &2.
wa_fcat-tabname = &3.
wa_fcat-emphasize = &4.
wa_fcat-ref_tabname = &5.
append wa_fcat to it_fcat.
END-OF-DEFINITION.
DEFINE add_catalogue2.
wa_fcat1-col_pos = &1.
wa_fcat1-fieldname = &2.
wa_fcat1-tabname = &3.
wa_fcat1-emphasize = &4.
wa_fcat1-ref_tabname = &5.
append wa_fcat1 to it_fcat1.
END-OF-DEFINITION.
DEFINE add_catalogue3.
wa_fcat2-col_pos = &1.
wa_fcat2-fieldname = &2.
wa_fcat2-tabname = &3.
wa_fcat2-emphasize = &4.
wa_fcat2-ref_tabname = &5.
append wa_fcat2 to it_fcat2.
END-OF-DEFINITION.
PERFORM f_build_fcat.
PERFORM f_build_fcat1.
PERFORM f_build_fcat2.
PERFORM f_build_layout.
PERFORM f_build_events.
PERFORM f_bloc_display.
*& Form f_select_data
FORM f_select_data .
SELECT matnr
mbrsh
matkl
FROM mara INTO TABLE it_mara WHERE matnr
IN so_matnr.
IF it_mara[] IS NOT INITIAL.
SELECT matnr
maktx
FROM makt
INTO TABLE it_desc
FOR ALL ENTRIES IN it_mara
WHERE matnr EQ it_mara-matnr.
ENDIF.
IF it_desc[] IS NOT INITIAL.
SELECT matnr
werks
lgort
labst
FROM mard
INTO TABLE it_mard
FOR ALL ENTRIES IN it_desc
WHERE matnr EQ it_desc-matnr.
ENDIF.
ENDFORM. " f_select_data
*& Form f_build_fcat
FORM f_build_fcat .
add_catalogue2:
'1' 'MATNR' 'IT_MARA' 'C500' 'MARA',
'2' 'MBRSH' 'IT_MARA' 'C600' 'MARA',
'3' 'MATKL' 'IT_MARA' 'C300' 'MARA'.
ENDFORM. " f_build_fcat
**& Form f_build_fcat1
FORM f_build_fcat1 .
add_catalogue1:
'1' 'MATNR' 'IT_DESC' 'C500' 'MAKT',
'2' 'MAKTX' 'IT_DESC' 'C600' 'MAKT'.
ENDFORM. " f_build_fcat1
*& Form f_build_fcat2
FORM f_build_fcat2.
add_catalogue3:
'1' 'MATNR' 'IT_MARD' 'C500' 'MARD',
'2' 'WERKS' 'IT_MARD' 'C600' 'MARD',
'3' 'LGORT' 'IT_MARD' 'C200' 'MARD',
'4' 'LABST' 'IT_MARD' 'C300' 'MARD'.
ENDFORM. " f_build_fcat2
*& Form F_BLOC_DISPLAY
* text
FORM f_bloc_display .
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fcat1
i_tabname = 'IT_MARA'
it_events = it_event
*IT_SORT =
*I_TEXT =
TABLES
t_outtab = it_mara
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fcat1
i_tabname = 'IT_DESC'
it_events = it_event
*IT_SORT =
*I_TEXT =
TABLES
t_outtab = it_desc
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fcat2
i_tabname = 'IT_MARD'
it_events = it_event
*IT_SORT =
*I_TEXT = ' '
TABLES
t_outtab = it_mard
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " F_BLOC_DISPLAY
*& Form F_BUILD_LAYOUT
FORM f_build_layout .
wa_layout-edit = 'X'.
wa_layout-window_titlebar = 'MOHAMMED ABDUL HAI'.
wa_layout-zebra = 'X'.
ENDFORM. " F_BUILD_LAYOUT
*& Form F_BUILD_EVENTS
FORM f_build_events .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_event
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
SORT it_event BY name.
READ TABLE it_event INTO wa_event WITH KEY name = 'TOP_OF_PAGE' BINARY
SEARCH.
IF sy-subrc EQ 0.
wa_event-form = 'F_TOP_OF_PAGE'.
ENDIF.
MODIFY it_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
READ TABLE it_event INTO wa_event WITH KEY name = 'USER_COMMAND' BINARY
SEARCH.
wa_event-form = 'F_USER_COMMAND'.
MODIFY it_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
ENDFORM. " F_BUILD_EVENTS -
Assigning object reference values to field symbols
Okay.......has anyone out there figured out how to assign the reference value of an object (you know the value you see in the debugger for example: .........to a field symbol.
I know there has to be a way and was wondering if anyone has successfully achieved this. Its easy to assign a memory area to a field symbol if its an itab like this below:
field-symbols: <fs>.
data: v_fieldname(20) type c.
v_fieldname = '(SAPLMEREQ)MARA'.
assign (v_fieldname) to <fs>.
This shouldn't be impossible with code like:
field-symbols: <fs> type ref to object.
data: v_ref(100) type c.
v_ref = '{O:666*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_ITEM_STATE}'.
assign (v_ref) to <fs>.
I just know that the code above doesn't work....
Any suggestions? And please......no questions about "why" or "what do I want to accomplish?" .....
MikeHello Michael
I assume you have not yet seen the following links:
ABAP OO - MEREQ (Purchase Req) - Protected Attributes
[Accessing the Inacessible - Local Classes within Global Classes|https://wiki.sdn.sap.com/wiki/display/ABAP/AccessingtheInacessible-LocalClasseswithinGlobalClasses]
Regards
Uwe -
Assigning field value to Field symbol
Dear Experts,
I have one program which works fine in non unicode system.. The program contains Assign statement with offset and length..
This program dumps in Unicode system due to this instruction.. The field which i want to assign to field symbol is type P field..
Is there any ways to avoid the dump?
Thank you in Advance..Hi,
isn't it an ABAP question in an EP forum?
Romano -
Passing value from field symbol / variable type ref to data to variable
hey ,
DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
DATA: RT_CARRID TYPE REF TO DATA.
FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE
.* Retrieve the data from the select option
RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
Assign it to a field symbol
ASSIGN RT_CARRID->* TO <FS_CARRID>.
how can i pass RT_CARRID or <FS_CARRID> to a varible with type vbap-netgrw ( net weight ) ?
thanks
ASA>
ASA MOKED wrote:
> hey ,
>
>
> DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
> DATA: RT_CARRID TYPE REF TO DATA.
> FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE
>
> .* Retrieve the data from the select option
> RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
> * Assign it to a field symbol
> ASSIGN RT_CARRID->* TO <FS_CARRID>.
create a work area of type <FS_CARRID>.
field-symbol: <fs_wa> type line of <FS_CARRID>.
loop at <FS_CARRID> into <fs_wa>.
lv_netgr = <fs_wa>-netgr. -
Error while inserting value Qualified field in the main table
Hello,
I am trying to populate Qualified field in the main table when a new record is inserted in the Products Repository.
The field is Reference Price and its a qualified lookup field. I am using the below code to create qualified lookup value and create qualified link values.
QualifiedLookupValue qlvRefPrice = new QualifiedLookupValue();
TableId qltabid = repSchema.getTableId("ReferencePrices");
FieldId qlfieldid = repSchema.getFieldId("ReferencePrices","RP_ReferncePrices");
RecordId rdRefPrice = getRecordId(connPool,session,"RP",qlfieldid,qltabid);
HashMap map = new HashMap();
map.put(repSchema.getFieldId("ReferencePrices","StartDate_ReferencePrice"),new DateTimeValue(cal));
map.put(repSchema.getFieldId("ReferencePrices","EndDate_ReferencePrice"),new DateTimeValue(cal));
map.put(repSchema.getFieldId("ReferencePrices","ListPrice"),new FloatValue(Float.parseFloat("123.3")));
map.put(repSchema.getFieldId("ReferencePrices","Currency"),new LookupValue(getLookupRecordId(connPool,session,"Currencies","Currency_Currencies","EUR")));
QualifiedLinkValue qlvLinkValue = MdmValueFactory.createQualifiedLinkValue(rdRefPrice,map);
qlvRefPrice.addValue(qlvLinkValue);
emptyRecord.setFieldValue(fieldIdRefPriceHistory,qlvRefPrice);
However when the createrecord command is executed I get the following error.
java.lang.RuntimeException: No matching validation Id 97. at com.sap.mdm.internal.validation.ValidationInfoHelper.retrieveValidations(ValidationInfoHelper.java:71) at com.sap.mdm.data.commands.CreateRecordCommand.execute(CreateRecordCommand.java:246) at com.alcatel_lucent.productdetail.ProductItemDetail_Comp.createProduct(ProductItemDetail_Comp.java:2927) at com.alcatel_lucent.productdetail.wdp.InternalProductItemDetail_Comp.createProduct(InternalProductItemDetail_Comp.java:656) at com.alcatel_lucent.productdetail.ProductItemAddView.onActionSave(ProductItemAddView.java:971) at com.alcatel_lucent.productdetail.wdp.InternalProductItemAddView.wdInvokeEventHandler(InternalProductItemAddView.java:662) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:761) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:696) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73) at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:869) at com.sap.tc.webdynpro.portal.pb.impl.localwd.LocalApplicationProxy.sendDataAndProcessAction(LocalApplicationProxy.java:77) at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1356) at com.sap.portal.pb.PageBuilder.SendDataAndProcessAction(PageBuilder.java:327) at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:869) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:332) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:219) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
I spoke to my MDM team and they say there is no validation which they have put for Reference Price field. I have tried inserting values in another field of type qualified lookup in the same main table and that works without any issue.
The code is as below:
QualifiedLookupValue qlvRating = new QualifiedLookupValue();
TableId qlvtable = repSchema.getTableId("ProductRatings");
FieldId qlvratinglink = repSchema.getFieldId("ProductRatings","RatingLink");
RecordId rdidPR = getRecordId(connPool,session,"CI",qlvratinglink,qlvtable);
wdComponentAPI.getMessageManager().reportSuccess("rdidPR "+rdidPR);
HashMap mapPR = new HashMap();
mapPR.put(repSchema.getFieldId("ProductRatings","AvailRating"),new LookupValue(getLookupRecordId(connPool,session,"AvailabilityRatings","AvailabilityRating_AvailabilityRatings","CI")));
mapPR.put(repSchema.getFieldId("ProductRatings","EffectiveDate"),new DateTimeValue(cal));
mapPR.put(repSchema.getFieldId("ProductRatings","FERAIndic"),new LookupValue(getLookupRecordId(connPool,session,"ReplacementIndicators","Code","FE")));
mapPR.put(repSchema.getFieldId("ProductRatings","FERAOrdItem"),new LookupValue(getLookupRecordId(connPool,session,"ReplProducts","ProdID","100008200")));
QualifiedLinkValue qlvLink = MdmValueFactory.createQualifiedLinkValue(rdidPR,mapPR);
qlvRating.addValue(qlvLink);
emptyRecord.setFieldValue(fieldIdRatingHistory,qlvRating);
I would really appreciate if someone can help in solving the issue.
Thanks in advance,
AamodHi Aamod,
Sees that some validation/assignments are getting triggered as soon as you make changes to the record in MDM. Please check once after removing validations/workflow that you may have. This way you may debug the issue.
Hope this helps!!
Cheers,
Arafat -
Moving Values to fields of different data types- Conversion
I'm having trouble figuring out how to move a value from a field of a <b>char type</b> to a field of <b>structure RSDSSELOPT</b> type in a different itab.
I'll show you what I have so far.
DATA: BEGIN OF ITABAPI OCCURS 0,
SEARCHFLD LIKE ZDOLTARC03-SEARCHFLD,
VALUE LIKE ZDOLTARC03-VALUE,
END OF ITABAPI.
DATA: BEGIN OF ITAB_GO occurs 0,
FIELDNAME LIKE RSDSTABS-PRIM_FNAME,
SELOPT_T TYPE RSDS_SELOPT_T,
END OF ITAB_GO.
LOOP AT ITABAPI.
MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME,
<b>ITABAPI-VALUE TO ITAB_GO-SELOPT_T.</b>
APPEND ITAB_GO.
ENDLOOP.
As an alternative I tried feeding the value into ITAB_GO-selopt_t-low, but breaking down the structure that far may be beyond the capabilities of the processor.
If anyone knows a way to feed a char value into the structure field please help.
N LHi Natasha,
my advice is: don't try to do it in just step. Instead,
DATA: LT_RANGE TYPE TABLE OF RSDSSELOPT WITH HEADER LINE.
LOOP AT ITABAPI.
MOVE: ITABAPI-SEARCHFLD TO ITAB_GO-FIELDNAME.
CLEAR: LT_RANGE.
REFRESH: LT_RANGE.
LT_RANGE-SIGN = 'I'.
LT_RANGE-OPTION = 'EQ'.
LT_RANGE-LOW = ITABAPI-VALUE.
APPEND LT_RANGE.
ITAB_GO-SELOPT_T[] = LT_RANGE[].
APPEND ITAB_GO.
ENDLOOP.
Pls let us know if it helped. BR,
Alvaro -
How to Remove Previous Values in Field Symbols
Hi,
My code goes like this.
Loop at i_vbap.
read table itab assigning <fs>.
if sy-subrc = 0.
endif.
Endloop.
This is good if my subrc for read is always 0. however, if my subrc = 4, my <fs> still contains the previous values. How do i clear my <fs> with the previous values?
Thanks,
JimHi
In your code please do the following
Loop at i_vbap.
Unassign <fs>.
read table itab assigning <fs>.
if sy-subrc = 0.
endif.
The problem would arise if you are using <fs> below without it being assigned.
It would cause a short dump.
So change your coding appropriately.
Endloop. -
Passing field symbol value to a variable
Hi All,
I have a value in Field Symbol declared as <FS-STATUS> TYPE STANDARD TABLE.
I want to use the value <fs-status> -low in a case statement.
For this i think i have to pass the <fs-status> -low into a variable and then use in case statement.
Can anyone explain how to pass values in field symbol to variable? Or if this is not possible is there any other solution.
Thanks in advance.Hi ,
I have give some code sample ; just check ..
DATA: BEGIN OF line,
col1(1) TYPE c,
col2(1) TYPE c VALUE 'X',
END OF line.
FIELD-SYMBOLS <fs> LIKE line.
ASSIGN line TO <fs>.
MOVE <fs>-col2 TO <fs>-col1.
WRITE: <fs>-col1, <fs>-col2.
Or u can check this link :
http://www.erpgenie.com/abaptips/content/view/401/62/ -
Field Symbol not writing the values while executing in background.
Hi,
In my program i am writing the values of a field symbol to list output.
write :/ <f_fs_up_excel_wa2>.
Its writing successfully when i am executing in foreground.
But when i am executing in background(Submitting the same program as a job)
its not displaying the values from field-symbol but all the other write statments are getting displayed in the spool.
Could anybody help me out in this situation and how to handle it?
Thanks,
SAM.Hmm. I think the problem is that the field-symbols is blank in background processing, rather than background process has some fault that prevents it being displayed...
On that basis - how is this field-symbol populated?
matt
Maybe you are looking for
-
How can you get an applet to obey the CSS z-index attribute?
How can you get an applet to obey the CSS z-index attribute? I have a DHMTL page with a panel that I want to slide back and forth. But another part of the requirement is to have the panel look like it is sliding under another panel. The problem is th
-
HELP! continous flashing amber light
So I have the Airport Express product. Its plugged in, I tried connecting the ethernet cable from the cable modem to the ethernet slot into the Airport slot. Plugged it into the power, flashes green for a second, then amber and continues to flash amb
-
Latest photos not coming across to iPhone 5 from iPhoto 11 :-(
What is wrong with iPhoto 11 and iPhone 5? iPhoto refuses to copy the latest images to my Iphone 5 (or my iPhone 5 is refusing to get the latest images from iPhoto 11). Most go over but for some reason the last few photos don't/wont go across. Some w
-
I USE THE NETSCAPE COMPOSER 4.8 FOR MY WEBSITE. NOW THAT I HAVE A NEW MACBOOK I CANNOT DOWNLOAD THAT VERSION. WHAT VERSION OF NETSCAPE CAN I USE THAT IS COMPATIBLE? OR IS THERE A WAY TO GET OS9 FOR MAC BOOK PRO OS 10.4.8 THANKS, SUE
-
When attempting to burn, "The drive reported an Error..."
"The Drive reported an error: Sense Key=MEDUIM ERROR; Sense Code=X0C; WRITE ERROR" (Toast) also the 0x8002006E (with Apple OSX disk burner) sometimes get 0x80020063 I have not seen an answer and have been looking for a while as I am busy and don't ha