Type-incompatible in ABAP code in ECC 6.0
DATA: bhdgi-hf(1) TYPE c,
bhdgi-t1(70) TYPE c.
DO VARYING bhdgi-hf FROM bhdgi-t10 NEXT bhdgi-t11.
IF bhdgi-hf <> space OR bhdgi-index GE 70.
EXIT.
ENDIF.
bhdgi-index = sy-index.
ENDDO.
SHIFT bhdgi-t1 BY bhdgi-index PLACES.
bhdgi-index1 = 0.
DO VARYING bhdgi-hf FROM bhdgi-t169 NEXT bhdgi-t168.
IF bhdgi-hf <> space OR bhdgi-index1 GE 70.
EXIT.
ENDIF.
bhdgi-index1 = sy-index.
ENDDO.
bhdgi-index1 = 70 - bhdgi-index1.
bhdgi-index2 = bhdgd-lines - 61. "YYYY
IF bhdgi-index1 >= bhdgi-index2.
WRITE bhdgi-t1 TO bhdgd-line1+26(bhdgi-index2).
ELSE.
bhdgi-index2 = bhdgi-index2 + 27.
WRITE bhdgi-t1 TO bhdgd-line1+bhdgi-index2.
ENDIF.
The above code segment is developed in ECC 6.0. i got the following error message.
BHDGI-T1 and BHDGI-HF are type-incompatible.
Please help me..
Hi
Check the data element of the both fields
BHDGI-T1 and BHDGI-HF
they might be different
in ECC6.0
if they are simiilar then only you can use like that
declare both of them of similar type and use
Regards
anji
Similar Messages
-
Declaring deep types in ABAP code
I am struggling with the declaration of local types in an ABAP program. When I declare a structure that contains a component which I reference to a previously declared table type, the system gives a compile error.
The following code gives an error on the highlighted line:
types: begin of ts_docprop,
key type string,
value type string,
end of ts_docprop.
types: tt_docprop type standard table of ts_docprop.
types: begin of ts_document,
document_id type string,
document_type type string,
properties type tt_docprop, "<<<<< Error here
end of ts_document.
This results in the following error:
"TT_DOCPROP" has a generic type. Use of this type is only possible for typing field symbols and formal parameters
However, I am sure it must be possible to declare a deep type this way.
Instead, I have to resort to proxying declarations via data, which seems totally unnecessary:
types: begin of ts_docprop,
key type string,
value type string,
end of ts_docprop.
data: ls_docprop type ts_docprop.
types: tt_docprop like standard table of ls_docprop.
data: lt_docprop type tt_docprop.
types: begin of ts_document,
document_id type string,
document_type type string,
properties like lt_docprop,
end of ts_document.
The first method above would be analogous to declaring structures and table types in the DDIC and should work. What have I missed?Hi,
Try:
TYPES: BEGIN OF ts_docprop,
key TYPE string,
value TYPE string,
END OF ts_docprop.
TYPES: tt_docprop TYPE STANDARD TABLE OF ts_docprop WITH NON-UNIQUE DEFAULT KEY .
TYPES: BEGIN OF ts_document,
document_id TYPE string,
document_type TYPE string,
properties TYPE tt_docprop, "<<<<< Error here
END OF ts_document. -
ABAP code to get MM Movement Types into BI
Hi All,
I need help in ABAP code to extract data on MM tables for Purchase Price Variance Raw Material. I'm getting material documents for all reversals 102 movement type and not extracting followed up 544 or 543 values for same documents. I don't have much idea about ABAP in depth.
program using BSIS, BKPF , EKBE, MSEG, MKPF, EKPO tables to extract data.
See below pieces of code from program.
DATA: TEMP_AWKEY LIKE BKPF-AWKEY,
YEAR(4) TYPE N,
WRX_AMT TYPE BSEG-DMBTR,
PRD_AMT TYPE BSEG-DMBTR,
WP_AMT TYPE BSEG-DMBTR,
QTY TYPE BSEG-MENGE,
I_BSIS_WA TYPE I_BSIS_TYPE,
MATDOC TYPE MSEG-MBLNR,
MATDOC_YEAR TYPE MSEG-MJAHR,
PERIOD(2) TYPE N.
DATA:
ITAB_MSEG TYPE HASHED TABLE OF ITAB_MSEG_TYPE WITH UNIQUE KEY MBLNR MJAHR ZEILE WITH HEADER LINE INITIAL SIZE 0,
ITAB_MSEG2 TYPE HASHED TABLE OF ITAB_MSEG_TYPE WITH UNIQUE KEY MBLNR MJAHR ZEILE WITH HEADER LINE INITIAL SIZE 0,
READ TABLE ITAB_BSEG WITH TABLE KEY BUKRS = I_BSIS-BUKRS BELNR = I_BSIS-BELNR GJAHR = I_BSIS-GJAHR BUZEI = I_BSIS-BUZEI .
IF SY-SUBRC EQ 0.
MOVE :
ITAB_BSEG-MEINS TO I_BSIS-MEINS,
ITAB_BSEG-SHKZG TO I_BSIS-SHKZG,
ITAB_BSEG-MATNR TO I_BSIS-MATNR,
ITAB_BSEG-WERKS TO I_BSIS-WERKS,
ITAB_BSEG-MENGE TO I_BSIS-MENGE,
ITAB_BSEG-BEWAR TO I_BSIS-BEWAR,
ITAB_BSEG-DMBTR TO I_BSIS-DMBTR,
ITAB_BSEG-KTOSL TO I_BSIS-KTOSL,
ITAB_BSEG-XREF3 TO I_BSIS-XREF3,
ITAB_BSEG-PEINH TO I_BSIS-PEINH,
ITAB_BSEG-EBELN TO I_BSIS-EBELN,
ITAB_BSEG-EBELP TO I_BSIS-EBELP.
IF ITAB_BSEG-SHKZG = 'H' .
I_BSIS-DMBTR = I_BSIS-DMBTR * -1.
ITAB_BSEG-DMBTR = ITAB_BSEG-DMBTR * -1.
ENDIF.
IF NOT I_BSIS[] IS INITIAL.
SELECT * FROM MSEG
INTO CORRESPONDING FIELDS OF TABLE ITAB_MSEG
FOR ALL ENTRIES IN I_BSIS
WHERE MBLNR = I_BSIS-MATDOC
AND MJAHR = I_BSIS-MATDOC_YEAR
ORDER BY PRIMARY KEY.
LOOP AT ITAB_MSEG.
LOOP AT I_BSIS WHERE MATDOC = I_MSEG_WE-MBLNR. "AND MATDOC_YEAR = I_MSEG_WE-MJAHR.
MOVE :
ITAB_MSEG-BWART TO I_BSIS-BWART.
MODIFY I_BSIS TRANSPORTING BWART.
ENDLOOP.
ENDLOOP.
IF WA_ZBW_MM_PPVCALC-BWART = ' '.
MATDOC_YEAR = WA_ZBW_MM_PPVCALC-AWKEY+10(4).
MATDOC = WA_ZBW_MM_PPVCALC-AWKEY(10).
SELECT * FROM MSEG
INTO CORRESPONDING FIELDS OF TABLE ITAB_MSEG2
FOR ALL ENTRIES IN I_BSIS
WHERE MBLNR = MATDOC
AND MJAHR = MATDOC_YEAR
ORDER BY PRIMARY KEY.
LOOP AT ITAB_MSEG2.
WA_ZBW_MM_PPVCALC-BWART = ITAB_MSEG2-BWART.
ENDLOOP.
ENDIF.
Please let me know where I need to change the logic to pick all movement types documents.
Thanks,
SAP_BI_AP
Edited by: SAP_BI_AP on Jun 23, 2010 10:35 PMHi
There is one std tcode COOIS where u can get the information what u have asked
Pls check
regards
Vijay -
Is it possible to write an abap code be SAP SQL query.(ECC 6)
hello guys,
Is it possible to write an abap code be SAP SQL query.
Scenario : table A has a field say f1 of length 10 and table B has a field say s1 of lenght 20. in sap sql i am able to link all the other tables but i am not able to link
table Af1 --->Table Bs1. as the length doesnot match. so is it possibel that using abap code I can pick 10 characters from table A field f1 adjust it to 20 characters using abap and map it to field s1 of table B.
Please let me know how to accomplish this if possible.
thanks in advance!!Herm,
Adding code is done in the infoset.
Please do following:
> Goto SQ02
> Type in the infoset that the basis for your query, <change>
> Press <code> OR <shift><f8>
> Tou'll see 4 tabs: Extras, Selections, Code, Enhancements.
> GoTo tab Code
> Choose the coding section (<f4> gives you an overview)
> Enter the code.
You may set a breakpoint to see what the query in SQ01 will do with it.
Succes!
Frank -
Type incompatible while activating in ECC 6.0 after updating from ECC 4.6
<b>Error : VGARTI-DB and VGARTP are type-incompatible in DO...Varying..loop</b>
DATA: BEGIN OF VGARTP, " Vorgangsparameter
VGART LIKE TM07I-VGART, " char 2
XHINZ LIKE TM07I-XHINZ, " char 1
XZAEL LIKE TM07I-XZAEL, " char 1
XDIFF LIKE TM07I-XDIFF, " char 1
XNACH LIKE TM07I-XNACH, " char 1
END OF VGARTP.
DATA: BEGIN OF VGARTI, " Aktionen zur Vorgangsart " Changed for unicode compatibility
DB(6) TYPE C VALUE 'DB X ',
IB(6) TYPE C VALUE 'IBX ',
ID(6) TYPE C VALUE 'IDXXX ',
IN(6) TYPE C VALUE 'INX X',
IZ(6) TYPE C VALUE 'IZXX ',
ZB(6) TYPE C VALUE 'ZB XX ',
ZE(6) TYPE C VALUE 'ZE X ',
ZL(6) TYPE C VALUE 'ZL X ',
Z$(6) TYPE C VALUE '$$$$$$',
END OF VGARTI.
DO ANZ-SEGM TIMES VARYING VGARTP FROM VGARTI-DB NEXT VGARTI-IB.
IF VGARTP(2) = T158I-VGART.
EXIT.
ENDIF.
IF VGARTP = VGARTI-Z$.
MESSAGE E001 WITH SPACE SPACE SPACE 'VGARTI'.
ENDIF.
ENDDO.Shouldn't the variable you are "varying" be the same length / type as the "from" and "to" i.e. more like (from SAP help):
DATA: BEGIN OF TEXT,
WORD1(4) VALUE 'This',
WORD2(4) VALUE 'is',
WORD3(4) VALUE 'a',
WORD4(4) VALUE 'loop',
END OF TEXT.
DATA: STRING1(4), STRING2(4).
DO 4 TIMES VARYING STRING1 FROM TEXT-WORD1 NEXT TEXT-WORD2.
WRITE STRING1.
IF STRING1 = 'is'.
STRING1 = 'was'.
ENDIF.
ENDDO. -
How to receive an RFC message in PI ABAP stack from ECC
Hi mates,
I am involved in a scenario in which we want to receive a message in PI (ABAP stack) from ECC (ABAP stack as well).
We created a RFC destination (3) in sender system (ECC) so both stacks could be linked. However, we do not know how to receive this message once we are in PI Abap stack.
In sender system code, a call destination takes place, an this destination stands for the one destination i noted before.
BUT, as this RFC does not exist in PI, i wonder what steps have to be done in PI in order to be able to get the message from ECC.
Hope you guys can guide me through this. Any help
Thanks a lot in advance and best regards,
davidHi Anand,
No no, i do not want to create any sender RFC Comm Channel.
What i want is to receive (by means of no PI adapter) a message in PI (abap stack) from ECC (abap stack), just by a RFC connection (type 3) between both systems.
I will try to explain in more detail what i want to achieve:
1) A standard SAP program is executed in ECC, at the end, a call destination is done.
2) This destination call, calls an RFC destination that points to PI (RFC dest in SM59, type 3)
(Until now, nothing is done in PI, there is no sender adapter, we just linked both ABAP stacks)
3) In ABAP stack of PI, we want to receive the message, make any transformations and send the target emssage to PI adapters
4) From that moment on, a ordinary PI integration is done.
So my question is, what kind of stepd so i have to perform to get the message from ECC in PI without creating any object in PI (ESR, ID, i mean). Just as if we wanted to receive a RFC message, lets say, in BI (abap side) from ECC.
Hope you got me this time.
Thanks a lot in advance.
Best regards,
david
Edited by: David de Miguel on Dec 27, 2010 11:48 AM -
Type incompatible problem...
hi all,
When i m executing this code an error " p & c are type incompatible" is coming.
Please advise.
REPORT ztx1013.
PARAMETERS p(20) DEFAULT 'c::
\xxx
yyy'.
DATA: c, "current character
n. "next character
DO 19 TIMES VARYING c FROM p0 NEXT p1
VARYING n FROM p1 NEXT p2.
IF c NA ':\'.
CONTINUE.
ENDIF.
IF c = n.
WRITE: / 'duplicate', c, 'found', 'at position', sy-index.
ENDIF.
ENDDO.I fear you have to remove the varying and replace them with
pos = sy-index - 1.
c = p+pos(1).
n = p+sy-index(1).
(less elegant)
I always used varying with subfields of a structure not with characters of a field. Abap documentation points on fields :
<i>This addition is useful if you have a series of fields of the same type and the same distance from each other.</i>
Regards -
Hi All,
I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
Can any one help with how to used unix commands in ABAP?
Thanks in advance.
Regards,
HemendraThe recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc. For example:
Command name OS Type OS command Parameters for operating system command
Z_FILE_MOVE SunOS Customer mv ? ?
You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
Jonathan -
Needs sample ABAP code for field routine
Dear Expert,
There is a field "Pay Scale Group" in my DSO which stores the data in the format
AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
I need to write a field routine on the transformation between DSO and Cube.
Can any one please help me with the sample ABAP code for this scenario.
Some more examples for better understanding of the requirement:-
Data in DSO(Source) Data in Cube(Target)
=================== ===================
AA1/B1/CCC2/DD2/EEE1 EEE1
AAA1/BB2/CC1/DDD3/EE2 EE2
A2/BBB2/CC2/DDD3/EEE5 EEE5
AA2/BB1/C1/DDD3/EE3 EE3
A3/B1/CC2/DDD1/EE4 EE4
Many thanks in advance.
Regards,
Prakash
Please do not dump your code requirements in SDN
Edited by: Pravender on May 18, 2011 11:37 AMHi,
You can use the following code :
Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
My assumption is that there will always be 4 '/'.
In the field routine write the below code
data: V1(5) type c,
V2(5) type c,
V3(5) type c,
V4(5) type c,
V5(5) type c.
data : VAR1 TYPE /BIC/OIZPAY_SGRP.
split VAR 1 at '/' into V1 V2 V3 V4 V5.
result = V5.
V5 will be having the characters after the last '/' .That is V5 = EEE1.
Hope the above reply was helpful.
Kind Regards,
Ashutosh Singh
Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
Edited by: Ashutosh Singh on May 17, 2011 4:17 PM -
Creating a long text using ABAP code.. fm SAVE_TEXT
When you create an order via IW31 one of the options is to click on the text button and create a long text. I am basically trying to mimic this action from within my ABAP code.
The text id details are as follows:
Text Name 500000015000046 which is (5000000 + order number)
Language EN
Text ID KOPF Order header text
Text Object AUFK Order text
If i manually create the text within the transaction i am then able to view and update it via function modules READ_TEXT and SAVE_TEXT. But if the text has not already been created READ_TEXT obviously returns nothing as it does not exist and SAVE_TEXT does not seem to created it!
Anyone know how i would go about creating this text using ABAP code?
Hope this make a bit of sense
Thanks in advance
MartI have implemented the code as i think it should be. See below, can any see what is wrong. If i add init_text it makes no difference and adding the commit_text just makes it hang
DATA: IT_TEXTS type standard table of TLINE,
wa_texts like line of it_texts,
wa_txtheader type THEAD.
wa_txtheader-TDID = 'KOPF'.
wa_txtheader-TDSPRAS = 'EN'.
wa_txtheader-TDNAME = '500000015000056'.
wa_txtheader-TDOBJECT = 'AUFK'.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
wa_texts-tdformat = '*'.
wa_texts-tdline = 'hello'.
append wa_texts to it_texts.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = wa_txtheader
INSERT = 'X'
SAVEMODE_DIRECT = ' '
OWNER_SPECIFIED = 'X'
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = IT_TEXTS
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Enhancement-ABAP Code-Customized Field issue
Hi Experts,
Currently I am working on the BW3.5 version. We are using the standard SRM standard extractor 0BBP_TD_SC_1 and we enhance same extractor(populate the filed through CMOD - ABAP Code) with one customized field also. We are having issue on the customized field data which post from SRM system. I have verified the field value and value is fine in RSA3 in SRM source system. But while posting into the BW(PSA itself), its loading correct & wrong value. When i check the PSA for the particular load, It looks little strange. In the PSA, I can see correct value on my first record of the same SC and then next records has incorrect value of the same SC. Currently I am using the ODS as a data target. So finally i am getting the incorrect value on the customized field.
Ex Scenario:
Ex Customized Field: ZORGID
In SRM source system RSA3 Extractor Checker value:
Shopping Card No: 100
Customized Field: ZORGID=1
Shopping Card No: 200
Customized Field: ZORGID=2
In BW posting-PSA:
Shopping Card No: 100
Customized Field: ZORGID=2
Shopping Card No: 200
Customized Field: ZORGID=2
At the same time, if i do the selective deletion of the particular Shopping Card or group of SC in BW and do the full repair, then it gets a correct ZORGID=1 for the same Shopping Card.
I strongly believe, something wrong in the ABAP code. But when we tried to debug the customized filed value in RSA3. The value is fine. so we unable to trace out the issue. Please help me to fix the code. Thanks in advance.
CMOD ABAP Code:
*Populate approver ID even though it doesn't require approval this is required to make sure BW reports have restrict access to respective Org Unit approvals only
IF l_s_bbp_sc-approver_id IS INITIAL AND l_s_bbp_sc-itm_guid IS NOT INITIAL.
CALL FUNCTION 'Z_BBP_FIRST_APPROVALGET'
EXPORTING
iv_header_guid = l_s_bbp_sc-guid
iv_itm_guid = l_s_bbp_sc-itm_guid
IMPORTING
approver_no = l_s_bbp_sc-approver_id
EXCEPTIONS
no_data = 1
OTHERS = 2
IF sy-subrc 0.
ENDIF.
ENDIF.
To ensure that the Org Unit passed in into the field
l_s_bbp_sc-zzapprov_orgunit belongs to the Actual Level 1
Budget Owner and not any other manager such as Added Approver.
CLEAR : ls_ln_approvers, l_userid, lv_bpartner_guid.
DATA : lv_f_apprv_part TYPE BU_PARTNER.
READ TABLE lt_ln_approvers INTO ls_ln_approvers
WITH KEY INITIAL_INDEX = '0000000001'.
IF sy-subrc EQ 0.
MOVE ls_ln_approvers-approval_agent+2(12) TO l_userid.
CALL FUNCTION 'BP_CENTRALPERSON_GET'
EXPORTING
iv_username = l_userid
IMPORTING
ev_bu_partner_guid = lv_bpartner_guid
EXCEPTIONS
no_central_person = 1
no_business_partner = 2
no_id = 3
OTHERS = 4.
IF sy-subrc = 0.
CALL FUNCTION 'BUPA_NUMBERS_GET'
EXPORTING
iv_partner_guid = lv_bpartner_guid
IMPORTING
ev_partner = lv_f_apprv_part.
ENDIF.
ENDIF.
We get the BP number of the first Budget Owner 1
Here, we superseed the field l_s_bbp_sc-approver_id
whereby it may be wrong due to Added Approver.
IF l_s_bbp_sc-approver_id IS NOT INITIAL.
IF lv_f_apprv_part IS NOT INITIAL.
IF l_s_bbp_sc-itm_guid IS NOT INITIAL.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'BP'
act_objid = lv_f_apprv_part
act_wegid = 'EBP-UP'
act_begda = sy-datum
act_endda = sy-datum
act_tdepth = 4
TABLES
result_tab = lt_result_tab
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3
IF sy-subrc = 0.
READ TABLE lt_result_tab INTO ls_result_tab WITH KEY
otype = 'O'.
IF sy-subrc EQ 0.
l_s_bbp_sc-zzapprov_orgunit = ls_result_tab-objid.
ELSE.
ENDIF.
ENDIF.
ENDIF.
Thanks,
RRHi Experts,
Any suggestions. Thanks.
Thanks,
RR -
IDOC: How to create child segment with abap code.
Hi,
I'am trying to write an abap code to create segments for an Idoc which structure is the following:
ZLE_00060_DLVY
> E1EDL20
> Z1DEL_CONS
>Z1DEL_MAT_HEADER
> Z1DEL_MAT
> E1EDL20RET2
> E1EDL22
> E1EDL21
> E1EDL23
> E1EDL51
I receive a sintax error: Error in IDoc with status 26 .
Checking the result I note all segment at the same level and an error about the segment E1EDL22
EDI: Syntax error in IDoc (segment cannot be identified)
Message no. E0078
Diagnosis
The segment E1EDL22 does not occur at the current level of the basic
type DELVRY05 (extension ZLE_00060_DLVY).
This error can have several reasons:
o The segment E1EDL22 is assigned to a group whose header segment does
not occur.
o The segment E1EDL22 does not exist in the syntax description of the
basic type DELVRY05 (extension ZLE_00060_DLVY).
o The sequence of segments in the group in which the segment appears
is incorrect.
Previous errors ('mandatory' segment or group missing) may be due to
this error.
Procedure
Please check the IDoc or the syntax description of the basic type
DELVRY05 (extension ZLE_00060_DLVY).
After the error I have:
data records
E1EDL20
Z1DEL_CONS
Z1DEL_MAT_HEADER
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
E1EDL20RET2
E1EDL22
E1EDL21
Abap code:
idoc_data-segnam = 'Z1DEL_CONS'.
idoc_data-sdata = s_z1del_cons.
append idoc_data.
idoc_data-segnam = 'Z1DEL_MAT_HEADER'.
s_z1del_mat_header-tsegment = 'MATERIAL'.
idoc_data-sdata = s_z1del_mat_header.
append idoc_data.
clear idoc_data-sdata. <<<<<<<<<<< how to indent the structure because this is a child.
idoc_data-sdata = s_Z1DEL_MAT.
idoc_data-segnam = 'Z1DEL_MAT'.
append idoc_data.
idoc_data-segnam = 'E1EDL20RET2'.
idoc_data-sdata = s_E1EDL20RET2.
append idoc_data.
clear idoc_data.
idoc_data-segnam = 'E1EDL22'.
idoc_data-sdata = s_e1edl22.
append idoc_data.
clear idoc_data.
idoc_data-segnam = 'E1EDL21'.
idoc_data-sdata = s_e1edl21.
append idoc_data.
Any help will be well appreciated.
Thanks in advance.
Regards,
GiovanniHi,
following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.
In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.
Then, I need to add a new segment and one child.
Any suggestion will be well appreciated.
Thanks in advance.
Regards,
Giovanni -
Schedule a background job for a program using ABAP code.
Hi,
I have to write a program to schedule a background job for another program.
Need your help to understand how we can achieve this functionality.Any example of an abap code would be of great help.
Need it urgently.
Thanks in advance.
Sandeep.Hi Sandeep,
Here is the demo program regarding the BDC For the background job.
report zprprbdc1
no standard page heading line-size 255.
include bdcrecx1.
parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
***data: begin of itab occurs 0 ,
*** matnr(20) type c,
*** mbrsh(30) type c,
*** mtart(30) type c,
*** kzsel(20) type c,
*** maktx(40) type c,
*** meins(5) type c,
*** end of itab.
data: begin of record occurs 0,
* data element: MATNR
matnr_001(018),
* data element: MBRSH
mbrsh_002(001),
* data element: MTART
mtart_003(004),
* data element: XFELD
kzsel_01_004(001),
* data element: MAKTX
maktx_005(040),
* data element: MEINS
meins_006(003),
* data element: MTPOS_MARA
mtpos_mara_007(004),
end of record.
*** End generated data section ***
start-of-selection.
*perform open_dataset using dataset.
perform open_group.
**do.
**read dataset dataset into record.
**if sy-subrc <> 0. exit. endif.
call function 'GUI_UPLOAD'
exporting
filename = 'c:\jitu\bdc\10002.txt'
filetype = 'ASC'
has_field_separator = 'x'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = record
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at record .
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-matnr_001.
perform bdc_field using 'RMMG1-MBRSH'
record-mbrsh_002.
perform bdc_field using 'RMMG1-MTART'
record-mtart_003.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
record-kzsel_01_004.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
record-maktx_005.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
record-meins_006.
perform bdc_field using 'MARA-MTPOS_MARA'
record-mtpos_mara_007.
perform bdc_transaction using 'MM01'.
**enddo.
endloop.
perform close_group.
*perform close_dataset using dataset.
&*****************Reward point if helpful************& -
How can I modify data from a Transparent Table without ABAP code.
Hi,All
How can I modify data from a Transparent Table (like TCURR), and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
I had fond that there is a way can do that:
1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
2, type '/h' and let debugging on
3, select one of this data then click 'Display',enter in debugging system.
4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
and, My system is ECC6.
thank you all
Edited by: xuehui li on Aug 20, 2008 6:30 PMHello,
Your approach (with Vijay's suggestion) MAY work. However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT. This will be especially true if you are working in a Production environment. Vijay's other comment is true as well. This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment. The auditors will not be impressed.
Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
Regards
Greg Kern -
Error in the ABAP Code for Customer Exit Variable
Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
In CMOD i had written the below Code:
When 'ZVWKNO'.
DATA: WEEK(2) TYPE N,
WEEKNO(2) TYPE N.
IF i_step = 1.
l_st_date = SY-DATUM.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = l_st_date
IMPORTING
WEEK = l_fn_week.
CHECK sy-subrc = 0.
WEEK = l_fn_week+4(2).
If WEEK 0.
WEEKNO = WEEK - 1.
l_s_range-low = WEEKNO.
l_s_range-sign = k_sign_inclusive.
l_s_range-opt = k_option_equals.
APPEND l_s_range to e_t_range.
ENDIF.
ENDIF.
But when i execute the query the default value is not populated with Week-1 No in the variable screen
Please update me what went wrong
ThanksCase ZVWKNO. "write this with out comments
When '1'. "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
DATA: WEEK(2) TYPE N,
WEEKNO(2) TYPE N.
IF i_step = 1.
l_st_date = SY-DATUM.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = l_st_date
IMPORTING
WEEK = l_fn_week.
CHECK sy-subrc = 0.
WEEK = l_fn_week+4(2).
If WEEK 0. "check this Week Minimum is '01' and Maximum '52'
WEEKNO = WEEK - 1.
l_s_range-low = WEEKNO.
l_s_range-sign = k_sign_inclusive.
l_s_range-opt = k_option_equals.
APPEND l_s_range to e_t_range.
ENDIF.
ENDIF.
Prabhudas
Maybe you are looking for
-
Having trouble setting up the volume on my ipod...
when i put on the sound check on on my pod it really knocks the volume way down, and i find if i boost the volume to my music tracks in my itunes settings {even with sound check off} that a certain percentage of my volume control {roughly the last te
-
I can't find the sharing quotes button in iBooks 3.
I googled and see the screencap of that sharing button in highlight section. But that's different in my iPhone and my iPad. After highlight a word/sentence, the option remain the same as in iBooks 2. Is there a setting or anything I have to change to
-
How can I extract an image from a website using HtmlAgilityPack and XPath? (C#)
Hello, everyone. I have been making a Comic Viewer in C#, and I'm stumped on how to actually load the comics. I installed HtmlAgilityPack and I have the XPath for the image I need, so I did some research and added the following code: string url = "ht
-
How do I create a believable colour change on a vibrant colour in photoshop?
Hi I work for the ambulance service and I only mess around with Photoshop CS6. I am trying to change a British ambulance to a firetruck red. The only problem is because the yellow is so vibrant when I adjust the hues it looks really fake (as you can
-
My son's imac has been shutting down on its own and not wanting to start up. Then it'll start up by itself and the fan is really loud. I followed the steps to reset the SMU but it didn't help. (turned off computer, removed all cables, including power