Today I’m using an internal table to implement the list of vendors. ( CORRESPONDING sflight( ls_sflight MAPPING price = price * 2 paymentsum = paymentsum + 30 ) ) ). L_str_sflight2-seatsocc = -seatsocc + 30 INĭATA(gt_sflight_new) = VALUE gty_sflight( LET lt_sflight = gt_sflight IN "Syntax error when adding "* 2" or "+ 30"ĭATA(gt_sflight_for2) = VALUE gty_sflight( I had two other ideas, but they result in syntax errors as soon I try to change the two fields: "Here I laboriously must enumerate the remaining 12 unchanged fields Is there any chance to default them?ĭATA(gt_sflight_for) = VALUE gty_sflight( LET lt_sflight = gt_sflight IN ENDLOOP, but then I tediously have to enumerate all the unchanged fields in the expression. I tried to have this with table comprehensions instead of LOOP. LOOP AT gt_sflight ASSIGNING FIELD-SYMBOL(). SELECT * FROM sflight INTO TABLE gt_sflight WHERE carrid = 'LH' AND connid = '400'. TYPES: gty_sflight TYPE SORTED TABLE OF sflight WITH UNIQUE KEY carrid connid fldate. Is there any chance to include the unchanged fields in an easy way in table comprehensions? I often have to update just a few fields in a broad internal table with many columns, the most of them remain unchanged. I reduced the values of an iteration into the output list of a display object, oh my … REDUCE outref( INIT out = cl_demo_output=>new( ) To conclude I show a cunning little thing that I use in some of my documentation examples: I only say nested REDUCE and VALUE operators … Now imagine, what you can do by mixing REDUCE with all the other expression enabled capabilities. These simple examples show the principle. with UNTIL or WHILE for conditional iterations.ĭATA itab TYPE STANDARD TABLE OF i WITH EMPTY KEY.You can use all kinds of FOR expressions in REDUCE: While VALUE and NEW expressions can include FOR expressions, REDUCE must include at least one FOR expression. And that’s where the new constructor operator REDUCE comes in. Now that we have all kinds of iterations available with FOR, we want to construct arbitrary types. ( col1 = j col2 = j + 1 col3 = j + 2 ) ).īut we don’t want to construct internal tables only. You can use it in constructor expressions with VALUE and NEW for so called table comprehensions, as e.g.ĭATA(itab2) = VALUE t_itab2( FOR wa IN itab1 WHERE ( col1 40 IT IS A VIOLATION PUNISHABLE UNDER LAW FOR ANY PERSON UNDER THE AGE OF TWENTY-ONE TO PRESENT ANY WRITTEN EVIDENCE OF AGE WHICH IS FALSE, FRAUDULENT OR NOT ACTUALLY HIS/HER OWN FOR THE PURPOSE OF ATTEMPTING TO PURCHASE ANY ALCOHOLIC BEVERAGE.With 7.40, SP05 the first version of the iteration operator FOR was introduced. Any person under the age of twenty-one years or.No person shall sell or give away any alcoholic beverages to:
0 Comments
Leave a Reply. |