Dear All,
Please let me know how to find the program-id of an ABAP program.
Thanx in advance.
Alok.
Dear All,
Please let me know how to find the program-id of an ABAP program.
Thanx in advance.
Alok.
Hi Experts and Gurus,
I have a requirement in changing layout for PO.
Header Text should be in the bottom.
How can it be possible?
Thanks for your help.
Hello ABAPers,
I have gone through many threads but did not find the solution. My requirement is that I am taking screen elements from table on the screen and I am performing validations on each field of the screen. Now, what I want now is that after failing of validation cursor focus should come on a particular field of the dialog screen where validation is failed.
I am using like this
SET CURSOR FIELD 'ZDB_TUSER-USER_EMPNAME'.
but still not getting cursor on this field.
Please help me..
points will be rewarded..
Yesterday we had an issue on an SAP implementation. I was sure that it was a standard error, because in other implementation the functionality works perfectly.
On Twitter Nicolas Busson reminded me that ANST can save your life quickly and easily
This video is the live implementation of the OSS Note using ANST.
I have another question out here about VF11 and user exits but in general:
For billing documents (for example program RV60AFZC), what triggers a user exit to run? I see that there are 15 user exits.
What triggers these? I mean if you go into VF11 and you execute, does that cause every one of those user exists to be processed or is each one of those a different reaction to something in VF11? Like execute will cause one to run, clicking the save button will cause another etc.
All info welcomed!!
P.S. I am looking for an exit that will allow me to update the date and time when someone runs a VF11. The exit called USER_EXIT_FILL_VBRK_VBRP will do this but it only fires off on invoice creation, not for VF11 transactions.
Also if you run a VF11, does it create an additional VBRK record in addition to the original invoice?
Thank you.
Hello folks,
System Information:
NW AS 7.03 ABAP Stack 731 Level 8, ECC 606 (EHP 6) with SAP_HR 604 Level 69 and EA_HR 607 (HR-Renewal 1) Level 20
Background:
The Report RPTARQDBVIEW (part of the HCM Leave Request application) is used for a selection of ABSREQ-typed receipts from the receipt database and allows for an output of an ALV-grid list.
Requirement/Problem:
The Report's ALV-output has to be loaded with a certain Layout Variant for a particular group of users, either depending of the user's R/3 Roles or due to a specific initial Transaction Code that is used to access the report in the first place.
What I did so far / Idea for an implementation / Question:
I've searched for the terms "ALV_Grid, Layout Variant, Dynamically, List Output" and found no information sources whatsoever concerning my problem (maybe my search parameters are nonsense?). I expected or rather hoped there to be some kind of magical output-variant-thingy I can use as a standard method to achieve my requirement but haven't found one, so I've debugged the horrible vast overhead of the frame program down to cl_gui_alv_grid-> set_table_for_first_display which I can theoretically enhance and interpret some prior set memory flag to execute some custom coding and just programatically implement my requirement with this means; this does work out. However, maybe I'm just blind to a more elegant and simpler solution which I didn't find/don't know of.
Any input is appreciated, especially that with a slap to the face and a pointing to a trivial SAP-Standard approach.
Cheers, Lukas
Hi everybody,
assuming I have strings like
45a46SSSS5646&544
jksdKJLKJL#POIPOIPOI
098FHGF*ksdlasködla
How can i find the first position (sy-fdpos) where a special character occurs?
Regards
Mario
Hi.
Is it possible to evaluate a substring in an object dependency? I want to write a simple OD that defaults a char field to a month code (the 2 digit month) based on another field which stores a date.
Something similar to this:
$set_default ($self,Z_PUB_MNTH,'01')
If Z_ON_SALE_DATE+4(2) = '01' 'date stored as string yyyyddmm
I'm getting these errors:
E28031 Comparison operator required
E28024 Syntax error in simple action/procedure
Any help would be much appreciated. Many thanks.
I created this program. The email with PDF is coming in SAP Business Workplace(SAP Inbox) (Tcode-SWBP), but the pdf contains junk characters.
Can someone help. I took this program from the discussion from SAP Forum
REPORT ZTESTM1.
TYPE-POOLS:slis.
DATA: lv_buffer TYPE string,
lt_mess_att TYPETABLEOF solisti1 ,
ls_mess_att TYPE solisti1.
CONSTANTS c_container TYPEc LENGTH 30VALUE'CC'.
CONSTANTS c_col1 TYPEc LENGTH 2VALUE' ~'.
CONSTANTS c_col2 TYPEc LENGTH 2VALUE'~ '.
CONSTANTS c_255 TYPEiVALUE255.
data p_recpnt TYPE sy-uname .
p_recpnt = sy-uname.
DATA : l_ref_bcs TYPEREFTO cl_bcs,
l_ref_document TYPEREFTO cl_document_bcs,
l_ref_recipient TYPEREFTO if_recipient_bcs,
l_ref_bcs_exception TYPEREFTO cx_bcs,
lv_sent_to_all TYPE os_boolean,
lv_filesize TYPE so_obj_len,
lv_doclines TYPEi,
lv_last_line TYPEi,
lv_text TYPE so_obj_des,
lv_data TYPE bcsy_text,
lv_size TYPEi,
gt_fcat TYPE lvc_t_fcat.
TYPES: ty_t_pdf TYPESTANDARDTABLEOF tline.
DATA: lt_pdf_output TYPE ty_t_pdf,
ls_pdf_output TYPE tline.
DATA:i_t001 TYPE t001 OCCURS0,
g_spool TYPE tsp01-rqident,
g_program TYPE sy-repid VALUE sy-repid.
DATA: w_print TYPE slis_print_alv,
w_print_ctrl TYPE alv_s_pctl.
START-OF-SELECTION.
SELECT * FROM t001 INTOTABLE i_t001 UPTO100ROWS.
CALLFUNCTION'SET_PRINT_PARAMETERS'
EXPORTING
destination = 'LOCL'" Printer
layout = 'X_65_512/2'"Format
line_count = '65'"Line Count
line_size = '1024'. "Line Size
w_print-print = 'X'.
CALLFUNCTION'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_program
i_structure_name = 'T001'
is_print = w_print
TABLES
t_outtab = i_t001.
IF sy-subrc <> 0.
MESSAGEID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
data: GET_SIZE_FROM_FORMAT VALUE'X'.
g_spool = sy-spono.
CALLFUNCTION'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = g_spool "Spool Number
no_dialog = space
dst_device = 'LOCL'"Printer Name
GET_SIZE_FROM_FORMAT = GET_SIZE_FROM_FORMAT
importing
pdf_bytecount = lv_size "Output Size
tables
pdf = lt_pdf_output "Spool data in PDF Format
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9.
IF sy-subrc EQ0.
LOOPAT lt_pdf_output INTO ls_pdf_output.
TRANSLATE ls_pdf_output USING c_col1.
CONCATENATE lv_buffer ls_pdf_output INTO lv_buffer.
CLEAR ls_pdf_output.
ENDLOOP.
TRANSLATE lv_buffer USING c_col2.
DO.
ls_mess_att = lv_buffer.
APPEND ls_mess_att TO lt_mess_att.
SHIFT lv_buffer LEFTBY c_255 PLACES.
IF lv_buffer ISINITIAL.
EXIT.
ENDIF.
CLEAR ls_mess_att.
ENDDO.
ENDIF.
*--create reference object
TRY.
l_ref_bcs = cl_bcs=>create_persistent( ).
lv_text = 'Mail Subject' .
APPEND'Mail Content'TO lv_data.
l_ref_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lv_data
i_subject = lv_text ).
* *--create document reference
lv_filesize = lv_size.
CALLMETHOD l_ref_document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_size = lv_filesize
i_attachment_subject = lv_text
i_att_content_text = lt_mess_att[].
* set the document
l_ref_bcs->set_document( l_ref_document ).
* create recipient
* p_recpnt = sap INBOX user ID to WHICH the ATTACHMENT is SENT.
l_ref_recipient = cl_sapuser_bcs=>create( p_recpnt ).
*adding recipient in to section
l_ref_bcs->add_recipient( l_ref_recipient ).
* send mail
CALLMETHOD l_ref_bcs->send(
EXPORTING i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
IF lv_sent_to_all = 'X'.
ENDIF.
CATCH cx_bcs INTO l_ref_bcs_exception.
IF l_ref_bcs_exception ISNOTINITIAL.
CLEAR l_ref_bcs_exception.
ENDIF.
ENDTRY.
COMMITWORK.
endif.
Hi,
I'm using ABAP to send e-mail and xml & txt file as attachment , when I open the file I recieved in the email inbox I found xml file content has been truncated or the content of txt file is space. Then I send some other files, it's OK. I've used value 'BIN' and ' ' as parameter of "i_attachment_type " ,neither of them worked fine.
I'm a newer in ABAP, any help will be appreciate.
FYI, my source code:
*&---------------------------------------------------------------------*
*& Report ZSENDMAILTEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSENDMAILTEST.
* This example shows how to send
* - a simple text provided in an internal table of text lines
* - and an attached MS word document provided in internal table
* - to some internet email address.
*
* All activities done via facade CL_BCS!
DATA: send_request TYPE REF TO cl_bcs.
DATA: text TYPE bcsy_text.
data: hex_content type solix_tab.
*DATA: hex_content TYPE soli_tab.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: bcs_exception type ref to cx_bcs.
data: sent_to_all type os_boolean.
START-OF-SELECTION.
PERFORM main.
*---------------------------------------------------------------------*
* FORM main *
*---------------------------------------------------------------------*
FORM main.
try.
* -------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
* -------- create and set document with attachment ---------------
* create document from internal table with text
APPEND 'Hello world!' TO text.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_length = '12'
i_subject = 'test created by BCS_EXAMPLE_2' ).
DATA: file TYPE string.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = 'TEST-3'
PARAMETER_1 = '.txt' " change to '.xml' when sending xml file
IMPORTING
FILE_NAME = file
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
write / 'cannot find phisical file name'.
ENDIF.
DATA : wa_bin type SOLIX.
* DATA : wa_bin type SOLI.
FIELD-SYMBOLS <hex_container> TYPE x.
* FIELD-SYMBOLS <hex_container> TYPE c.
* OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING UTF-8.
OPEN DATASET file FOR INPUT IN BINARY MODE.
DO.
ASSIGN wa_bin TO <hex_container> CASTING.
READ DATASET file INTO <hex_container>.
IF sy-subrc = 0.
append wa_bin to hex_content.
ELSE.
EXIT.
ENDIF.
ENDDO.
* write: / wa_bin.
CLOSE DATASET file.
* add attachment to document
* BCS expects document content here e.g. from document upload
* binary_content = .
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = ''
i_attachment_subject = 'test.txt' "when sending xml file change to test.xml
i_att_content_hex = hex_content.
* add document to send request
CALL METHOD send_request->set_document( document ).
* --------- set sender -------------------------------------------
* note: this is necessary only if you want to set the sender
* different from actual user (SY-UNAME). Otherwise sender is
* set automatically with actual user.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
* --------- add recipient (e-mail address) -----------------------
* create recipient - please replace e-mail address !!!
recipient = cl_cam_address_bcs=>create_internet_address(
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
* ---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
if sent_to_all = 'X'.
write text-003.
endif.
COMMIT WORK.
* -----------------------------------------------------------
* * exception handling
* -----------------------------------------------------------
* * replace this very rudimentary exception handling
* * with your own one !!!
* -----------------------------------------------------------
catch cx_bcs into bcs_exception.
write: 'Fehler aufgetreten.'(001).
write: 'Fehlertyp:'(002), bcs_exception->error_type.
exit.
endtry.
ENDFORM.
--------------------------------------------------------------------------------------------------
content of test.xml
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Worksheet ss:Name="Tabelle1">
<Table>
<Row>
<Cell><Data ss:Type="String">CPDEMO</Data></Cell>
<Cell><Data ss:Type="String">20110711</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">CTVBC02</Data></Cell>
<Cell><Data ss:Type="String">20110602</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">CTVBC01</Data></Cell>
<Cell><Data ss:Type="String">20110628</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">CTVPUR01</Data></Cell>
<Cell><Data ss:Type="String">20110520</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">CTVCE01</Data></Cell>
<Cell><Data ss:Type="String">20110520</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">BWIT01</Data></Cell>
<Cell><Data ss:Type="String">20110603</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">ALEREMOTE</Data></Cell>
<Cell><Data ss:Type="String">20131213</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">BWIT02</Data></Cell>
<Cell><Data ss:Type="String">20110711</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">BEXATBOE</Data></Cell>
<Cell><Data ss:Type="String">20130701</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">DBA01</Data></Cell>
<Cell><Data ss:Type="String">20110621</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">DDIC</Data></Cell>
<Cell><Data ss:Type="String">20140108</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">SAP*</Data></Cell>
<Cell><Data ss:Type="String">20110419</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">SAPCPIC</Data></Cell>
<Cell><Data ss:Type="String">00000000</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">TMSADM</Data></Cell>
<Cell><Data ss:Type="String">20110401</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">CPADMIN</Data></Cell>
<Cell><Data ss:Type="String">20110616</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">SNDADMIN</Data></Cell>
<Cell><Data ss:Type="String">20130114</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">BWREMOTE</Data></Cell>
<Cell><Data ss:Type="String">00000000</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">17124</Data></Cell>
<Cell><Data ss:Type="String">20131216</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">F3228773</Data></Cell>
<Cell><Data ss:Type="String">20140108</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">SNDBWIT</Data></Cell>
<Cell><Data ss:Type="String">20140104</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">SAPBIMETA</Data></Cell>
<Cell><Data ss:Type="String">20111020</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">9041</Data></Cell>
<Cell><Data ss:Type="String">20130807</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">FSK001</Data></Cell>
<Cell><Data ss:Type="String">20130815</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">F6969539</Data></Cell>
<Cell><Data ss:Type="String">20110801</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
Hi,
I have 3+ years of experience in SAP ABAP. Now, I want to do my Associate certification.
Below are the certification details for the SAP ABAP Associate level.
1) C_TAW12_70 (ABAP With Net weaver 7.0) - SAP Certified Development Associate
2) C_TAW12_71(ABAP With Net weaver 7.02) - SAP Certified Development Associate
3) C_TAW12_731(ABAP With Net Weaver 7.31) - SAP Certified Development Associate
I get confused which one I go for...
Can any one suggest, Which one best & suitable for me??
Thank you for your time.
Regards,
Arjun
Suppose we have a simple program ZBACKGROUND_TASK which needs to be executed in the background.
It has only one statement: WRITE: / 'Hello I am running in background!'.
Create a new user event via tcode SM62:
in SM36, define a new background job Z_TEST_JOB, click Start condition button:
Maintain the event name ZTEST_EVENT:
Click Step button, maintain the program name which is to be executed in the background.
After step maintenance is finished you could see the information message in SM36.
Write the program to start the background job:
EXPORTING
eventid = 'ZTEST_EVENT'
EXCEPTIONS
bad_eventid = 1
eventid_does_not_exist = 2
eventid_missing = 3
raise_failed = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE: 'Event failed to trigger'.
ELSE.
WRITE: 'Event triggered'.
ENDIF.
Once executed, check job status in SM37, it is in finished status.
Click the Spool button and we could see the list output via WRITE statement.
Use the function module JOB_OPEN and JOB_CLOSE in launcher program:
name TYPE tbtcjob-jobname VALUE 'JOB_VIA_CODE'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
WRITE:/ 'Generated job number: ', number.
IF sy-subrc = 0.
SUBMIT zbackgroud VIA JOB name NUMBER number AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
WRITE:/ 'job close Error!'.
ENDIF.
ENDIF.
ENDIF.
Once executed it returns the job number 04175800:
The job number could be found also in SM37:
For me I prefer the first approach as it decouples the background program and the launcher program.
Hi all,
I am facing issues while sending PO to vendor through external send via email in PDF.
All the configurations have been done in NACE with program name used as the customized one.
Communication strategy has been maintained.
But still while creating PO in message following errors are stated for external send o/p type
Please can anyone let me know what are these errors related to? As we have done all the necessary settings.
Thanks.
Hi,
I have a requirement wherein for process orders, all the information is present in the LOIPRO except batch number. So I have extended this Idoc with extension ZLOIPRO01 and have added a segment ZE1AFPOL under E1AFPOL segment.
I have added the extension in WE82(message type) and configured the extension in WE20(partner profile).
After that I have added the code in exit EXIT_SAPLLOI1_002 and created the project in CMOD and activated the code.
All the segments are coming when I am running POIT but my new segment is not appearing in WE02.
Also this particular exit is not triggering.
Am I missing something there?
Please suggest
Hi All,
I have a requirement to add an additional sub screen in WCTL Transaction ,
now i have added it through BADI_WCM_WCA_001
But my problem is with out changing the any standard objects i need to display that sub screen
for only a particular plant,
how to include this condition ?
Is this possible using the Filter condition? (I have tried this but i am not able to control the screen)
if yes please let me know the process?
Thanks,
Pavan
Sytem message 042 from work area SSFCOMPOSER does not exist
System showing this error while executing PO smartform on Quality Server .
this development working ok on Development server.
please suggest solution.
Dear ABAP Gurus,
I am getting lot of short dumps upon adjustment of data length of domain( reduced to 10 from current length of 40) and then using DB utlitity, and I am using it for PO screen enhancement using include CI_EKPODB. Now Table conversion has stopped at step 6(renaming of QCMEKPO to EKPO failed).
I am going thru already posted threads.
Can you guide me how to proceed.
regards,
Gautam
Hi,
I have to trigger the HRMD_A05 IDOC only when certain fields are changed in PA30 transaction.
I have activated changepointers globally in BD61 and for message type HRMD_A in BD50 and need to add the fields and table name in BD52?
How do I find the Object for this change document items for BD52?
Thanks
Hi all,
I have a requirement of updating 2 custom fields Project Id and Location description in DFKKOP table, the data is coming from SD while invoicing to FICA.
I am using FQEVENT 4000 to update the fields using structure FKKRW_ACCIT, but it is not updating the table.
Is there any other Event that needs to be updated for the same?
Quick Response would be appreciated.
Regards,
Ginni