Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

Dynamic Background Color In SmartForm

$
0
0

Hi All The Gurus,

 

I have made a Block List ALV Report which is having background color based on condition. It is working fine.In my internal table T_MAIN apart from other fields one field is CELLCOLOR TYPE LVC_T_SCOL and based on condition I am filling CELLCOLOR as below

IF W_MAIN1-P_VIL2 GT '2' AND W_MAIN1-P_VIL2 LE '5'.

          S_CELLCOLOR-FNAME = 'VIL_2'.

          S_CELLCOLOR-COLOR-COL = '5'.                      "5 GREEN

          S_CELLCOLOR-COLOR-INT = '1'.

          S_CELLCOLOR-COLOR-INV = '0'.

          APPEND S_CELLCOLOR TO W_MAIN1-CELLCOLOR.

ENDIF.     .............................. And so on

 

This all is fine.Now the requirement is to make a Smartform. For that when calling SmartForm using Call Function FM_NAME I have used T_MAIN = T_MAIN in Tables Parameter.

I have created a Line Type and Structute which is having all the fields of T_MAIN along with CELLCOLOR type LVC_T_SCOL . Everything is activated. The Line type is ZINPP_PRD_MAIN_T and Structure is ZINPP_PRD_MAIN_S. In smartform in Form Interface under Tables Tab I have written T_MAIN1 TYPE ZINPP_PRD_MAIN_T.

But when I run this It is giving dump of Type conflict when calling the function module .....

The reason mention is It was tried to transfer the internal table "T_MAIN1[]" to the formal parameter

"T_MAIN1". In doing so, a type conflict occurred between the formal- and the

actual parameter.

 

Please help me what is the mistake .Is there any another way to do background color in Smartform based on condition.

 

Thanks & Regards,

 

Bharti Jain


LDB_PROCESS 'GLG'

$
0
0

Hi,

 

I've already used the FM LDB_PROCESS with SDF but it seems not working with GLG.

 

Anyone knows if this ldb has a different treatment?

 

Thanks

Detecting corrupted or damaged files

$
0
0

Hello everyone,

 

I made a web dynpro application that uses the class CL_ABAP_ZIP to upload ZIP files. I would like catch an error when the ZIP file is corrupted before using the method "load". Because this method dumps when the zip is corrupted. More precisely it dumps at this line :

 

<ext>-content = zip+offset(<ext>-compsize).

 

Any idea how to handle this ?


Thanks for your help.

how can i debug my abap program?

Need to send smart form as pdf without displaying smart form

$
0
0

I Need to send smart form as pdf in mail from list output with button click  without displaying smart form .I have searched the forum but those provide solution where we display the smart form and then send as pdf .

Generated maintenance views with "Customer include: SAP part"

$
0
0

Dear gurus,

 

I have a very confusing situation here. Perhaps someone has run into it before and knows what the cause is.

 

I have several customizing tables and generate maintenance views for them. All ok so far.

 

But 2 of them for no reason I can see have additional objects generated for them:

 

Function group with customer include: customer part (object type FUGX)

Function group with customer include: SAP part (object type FUGS)

 

I dont know where they came from. Without them the maintenance view dumps.

 

I only noticed them at all because ChaRM transports complained about the contents of the package including these objects which it did not permit to be transfered to a "Transport of Copies" type request.

 

Any clues? Searching does not show up anything special nor mention where they come from..  :-(

 

Cheers,

Julius

Dump while migrating condition record of table j_1btxcof via JIBTAX

$
0
0

Hello all,

 

After migrating condition records of table j_1btxcof via Tcode JIBTAX when user try to export the ALV list it is giving short dump "field symbol not assigned".

 

I can see field "COFINSLAW_KNUMH" is not present in the output structure i.e. ty_list_j_1btxcof ( Include J_1B_MIGRATE_TAX_RATES_TOP).

While same is present in the fieldcatalog.

 

 

I feel there must be some OSS note that is adding this field in the output structure but not able to find any.

 

Does anyone have any inputs on this issue.

 

Appreciate your help on this.

 

regards,

Lokesh

CRAETE OPERATION USING BAPI_ALM_ORDER_MAINTAIN

$
0
0

HI ABAP EXPERTS,

I am trying to create components and operations for an existing  order(IW32) .

i can create component correctly,but i face a problem creating new operation

this is my bapi

could you provide me solving the error?

DATA wa_header_up TYPE bapi_alm_order_headers_up.
 DATA itab_header_up TYPE TABLE OF bapi_alm_order_headers_up.
 DATA wa_operation_up TYPE bapi_alm_order_operation_up.
 DATA it_operation_up TYPE TABLE OF bapi_alm_order_operation_up.
 data:        IT_PLANT TYPE STANDARD TABLE OF  BAPI_ALM_ORDER_HEADERS_I-PLANPLANT, "HADY PLANT        WA_PLANT LIKE LINE OF IT_PLANT,
 it_methods type standard table of bapi_alm_order_method,
 wa_methods like line of it_methods,
 it_header type standard table of bapi_alm_order_headers_i,
 wa_header like line of it_header,
 it_header_up type standard table of bapi_alm_order_headers_up,
 it_header_srv type standard table of bapi_alm_order_srvdat_e,
 it_header_srv_up type standard table of bapi_alm_order_srvdat_up,
 it_userstatus type standard table of bapi_alm_order_usrstat,
 it_partner type standard table of bapi_alm_order_partn_mul,
 wa_partner like line of it_partner,
 it_partner_up type standard table of bapi_alm_order_partn_mul_up,
 it_operation type standard table of bapi_alm_order_operation,
 wa_operation like line of it_operation,
 *it_operation_up type standard table of bapi_alm_order_operation_up,
 it_relation type standard table of bapi_alm_order_relation ,
 it_relation_up type standard table of bapi_alm_order_relation_up ,
 it_component type standard table of bapi_alm_order_component,
 wa_component like LINE OF it_component,
 it_component_up type standard table of bapi_alm_order_component_up,
 it_text type standard table of bapi_alm_text,
 it_text_lines type standard table of bapi_alm_text_lines,
 extension_in type standard table of bapiparex,
 return type standard table of bapiret2,
 wa_return like line of return,
 et_numbers type standard table of bapi_alm_numbers,
 wa_numbers like line of et_numbers.  wa_methods-refnumber = 1.  wa_methods-objecttype = 'OPERATION'.  wa_methods-method = 'CREATE'.  wa_methods-objectkey = '%00000000001'.  APPEND wa_methods TO it_methods.  wa_methods-refnumber = 1.  wa_methods-objecttype = ' '.  wa_methods-method = 'SAVE'.  wa_methods-objectkey = ORDERNO.  APPEND wa_methods TO IT_methods.  wa_header-orderid = ORDERNO.  wa_header-order_type = 'ZSM2'.  wa_header-mn_wk_ctr = 'HAHV'.  WA_HEADER-EQUIPMENT = '000000000010008442'.  wa_header-start_date = '20150217'.  wa_header-FINISH_DATE = '20150217'.  wa_header-short_text = 'HEADER'.  wa_header-NOTIF_NO = '300002927'.  APPEND wa_header TO IT_header.  wa_header_up-mn_wk_ctr = 'X'.  WA_HEADER_up-EQUIPMENT = 'X'.  wa_header_up-start_date = 'X'.  wa_header_up-short_text = 'X'.  APPEND wa_header_up TO itab_header_up.  wa_operation-activity = '0010'.  WA_OPERATION-WORK_CNTR = 'HAHV'.  wa_operation-control_key = 'SM01'.  wa_operation-plant = 'BC20'.  WA_OPERATION-DESCRIPTION = 'OPERATION DESCRIPTION'.  APPEND wa_operation TO IT_operation.  wa_operation_UP-activity = 'X'.  WA_OPERATION_UP-WORK_CNTR = 'X'.  wa_operation_UP-control_key = 'X'.  wa_operation_UP-plant = 'X'.  wa_operation_UP-description = 'X'.  APPEND wa_operation_up TO IT_operation_up.     wa_methods-refnumber = '000001'.     wa_methods-objecttype = ''.     wa_methods-method = 'SAVE'.     wa_methods-objectkey =  ORDERNO.     append wa_methods to it_methods.     clear wa_methods.     wa_methods-refnumber  = '000001'.                    " Component      wa_methods-objecttype = 'COMPONENT'.     wa_methods-method     = 'CREATE'.     wa_methods-objectkey  = ORDERNO.     append wa_methods to it_methods.     clear wa_methods.     wa_component-ACTIVITY                      = '0010'.     wa_component-material                      = 'TY-120'.     Wa_component-item_cat                      = 'L'.     wa_component-unload_pt                     = 'XXX'.     wa_component-requirement_quantity          = '4'.     wa_component-planT          = 'BC20'.     append wa_component to it_component.     clear wa_component.     refresh return.
 BREAK ABAPTEAM.     refresh return.     call function 'BAPI_ALM_ORDER_MAINTAIN'       TABLES         it_methods       = it_methods         it_header        = it_header         it_header_up     = it_header_up         it_header_srv    = it_header_srv         it_header_srv_up = it_header_srv_up         it_userstatus    = it_userstatus         it_partner       = it_partner         it_partner_up    = it_partner_up         it_operation     = it_operation         it_operation_up  = it_operation_up         it_relation      = it_relation         it_relation_up   = it_relation_up         it_component     = it_component         it_component_up  = it_component_up         it_text          = it_text         it_text_lines    = it_text_lines         extension_in     = extension_in         return           = return         et_numbers       = et_numbers.  DATA : XX TYPE I VALUE 0.     loop at return into wa_return.       IF WA_RETURN-TYPE = 'S'.         FLAG = 1.         ELSE.         FLAG = ''.         write:/   WA_RETURN-MESSAGE.       ENDIF.     endloop.     call function 'BAPI_TRANSACTION_COMMIT'       EXPORTING         wait = 'X'.     CALL FUNCTION 'DEQUEUE_ALL'       EXPORTING         _SYNCHRON = 'X'.     commit work and wait.

Workflow for budget exceeded via SMS

$
0
0

Dear Experts,

 

Is it possible that instead of e-mail system could trigger SMS or both SMS and e-mail to the Project Manager's cell phones on budget exceeded notifications?

 

Which is the easiest approach to do it?

 

Thanks & Regards

Saurabh

Debugging to Understand the process?

$
0
0

Hi Experts.

My company went back to work with the module 'RE'.

I'm working with functional FI working like RE.

Occurred a  Dump:  (Overflow during the arithmetical operation (type P) in program).Please see attached file.

 

- REAJPR Transaction.

-The error ocurred in productive envoirement.

-The functional didnt find in configuration the motive of DUMP.

-The error ocurred because a field size receiving incompatible variable .i find a sap note ,etc...

ld_indexchgperlast = abs( <ls_recindex>-indexchgpoilast ). 

 

-But the functional sayed that error ocurred because the wrong value in variables and he wants that i debug and understand how this

variables are fulfilled.

-I debugged and found

 

rd_indexchgpoilast = ld_dateindexbase - ld_lastadjmindexbase.

 

Now i need  to understand  how this variables ( ld_dateindexbase and  ld_lastadjmindexbase ) are fulfilled.

 

 

Somebody know a way to do it ?

With debug its very very hard and tiresome.

 

I accept suggestions.

 

thanks a lot.

SM30 - ShortDump SAPSQL ARRAY INSERT DUPREC /// SAP-SCRIPT

$
0
0

Dear all,

i created a customer table which is maintainanced over SM30.

 

When i'm saving the new entries i get every time a shortdump, when i enter a key which is in the table,
the program dumps.

 

How can i prevent this dump?
Is there no opportunity to to throw a message or something like that?

 

I dont know, if this is important but i'm using the events for some selection after entering a value. :-)

 

 

2.
My Second Question:
Is there an opportunity to define the output lenght of my materialnumber ( for example ) dynamically?

 

If the number is 10 digits long -> make the output-size smaller
If the number is 3 digits long -> make nothing with the size?

 

Can i adjust my output dynamically?

 

 

 

 

Best Regards  and thank you all in advance,
Serhat

Can you loop on a deep-structure itab within Smartforms?

$
0
0

I know that Smartforms lets you pass a table to Smartforms and that you can loop on this itab.

 

But suppose the itab has deep-structure - each row has another itab in it.  (This is common, for example, in APO.)

 

Then within the outer loop on the outer itab, can you loop on the inner itab within each row?

 

Thanks for your kind advice here.

R3 CHINESE PROVINCE CODES

$
0
0

Hello all,

 

I am trying to find a list of of acceptable Region Codes (ADRC_REGION) for the 22 provinces of China.  I would greatly appreciate any feedback, including a better forum to post this question in.

 

Thank you.

enhancing standard search help exit

$
0
0

Hi all,

 

I want to filter out WBS Elements field in CAT2 transaction. The seatch help associated with it is standard (PRPM).

The search help has an standard exit CN_LDST_SHLP_EXIT_PS_PR.

 

I cannot modify the code but can only create implicit enhancement at the beginning and at the end.

 

My code should be like below. But I put this code at beginning or end, it doesn't have any effect

 

 

IF CALLCONTROL-STEP = 'DISP'.

    LOOP AT RECORD_TAB INTO WA_TEMP WHERE STRING CP '*PG*'.

      APPEND WA_TEMP TO IT_TEMP.

      CLEAR: WA_TEMP.

    ENDLOOP.

    CLEAR: RECORD_TAB[].

    RECORD_TAB[] = IT_TEMP[].

    CLEAR: IT_TEMP[].

  ENDIF.

 

 

Because in the middle standard code is written as

 

IF CALLCONTROL-STEP = 'DISP'.
EXIT.

ENDIF.

 

 

Can you please advise if I should copy the search help to a Z version and then do all the configuration required to attach it to the CAT2 screen

 

Or is there any easy way to achieve this using the standard exit only?

 

Thanks

Arindam

Read html page content.

$
0
0

Hi,

 

I have a require. Let me explain with example.

 

html Page:

html.JPG

Code Page:

<html>
<body>
<p id="p1">Hello World!</p>
<input type="text" name="firstname">
<input type="button" value="1" name="no" onclick="moveNumbers()">
<script>
function moveNumbers()
{
document.getElementById("p1").innerHTML = document.getElementById("p1").value;
}
</script>
</body>
</html>

 

Through interface "IF_HTTP_CLIENT" i am able to read code page,

but my requirement is read "123456" information from html body.

 

Is any class or method exist in SAP, please suggest.

 

Regards.

Praveer.


How to check in BADI , The previous data updated or not successfully

$
0
0

Hi

 

If we use SET UPDATE TASK LOCAL in BADI , How to check the data has been successfully updated or not , Before going to do further changes on the second update.

 

I want to check the 1st update successfully completed or not.

Save layout options not working in custom controller screen

$
0
0

  Hi Frds,

 

 

Unable to create layout save option . Pls help me.

 

I have been reffered these report also BCALV_GRID_09.layoutt.jpg

How to download sap script to pdf and send to mail

$
0
0

Hi All,

 

Good Day!!!

 

my requirement is through custom program we are creating documents. in the out put we will get document numbers. when user check the document number and clock on print preview user can able to see the document. my requirement is when program creates documents I need to download into pdf and need to send to mail. I should not save the pdf in my desktop. it has to convert in program level and as well has to send to mail id.

 

for this I have written the following code.

 

 

 

CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.

  REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
*Creation of the document to be sent File Name
  maildata-obj_name = 'TEST'.
*Mail Subject
  maildata-obj_descr = 'Subject'.
*Mail Contents
  mailtxt-line = 'Here is your file'.
  APPEND mailtxt.

 

CLEAR: mailpack, mailbin, mailhead.
  REFRESH: mailpack, mailbin, mailhead.
  DESCRIBE TABLE mailtxt LINES tab_lines.
  READ TABLE mailtxt INDEX tab_lines.
  maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
*Creation of the entry for the compressed document
  CLEAR mailpack-transf_bin.
  mailpack-head_start = 1.
  mailpack-head_num = 0.
  mailpack-body_start = 1.
  mailpack-body_num = tab_lines.
  mailpack-doc_type = 'RAW'.
  APPEND mailpack.


CLEAR itcpo.
  itcpo-tdgetotf = 'X'.
  itcpo-TDDEST   = 'LOCL'.
  CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      device                      = 'PRINTER'
      dialog                      = ''
      form                        = 'ZRFI_NOTA_D_C'
      language                    = sy-langu
      OPTIONS                     = itcpo
    EXCEPTIONS
      canceled                    = 1
      device                      = 2
      form                        = 3
      OPTIONS                     = 4
      unclosed                    = 5
      mail_options                = 6
      archive_error               = 7
      invalid_fax_number          = 8
      more_params_needed_in_batch = 9
      spool_error                 = 10
      OTHERS                      = 11.
  IF sy-subrc = 1.
    p_cancelled = 'X'.
  ELSEIF 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 'CLOSE_FORM'
      IMPORTING
        RESULT                   = itcpp
      TABLES
        otfdata                  = otf
      EXCEPTIONS
        unopened                 = 1
        bad_pageformat_for_print = 2
        send_error               = 3
        spool_error              = 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.
*    *Move OTF code to structure SOLI form email
    CLEAR solisti1. REFRESH solisti1.
    LOOP AT otf.
      solisti1-line = otf.
      APPEND solisti1.
    ENDLOOP.


LOOP AT solisti1.
    MOVE-CORRESPONDING solisti1 TO mailbin.
    APPEND mailbin.
  ENDLOOP.
  DESCRIBE TABLE mailbin LINES tab_lines.
  mailhead = 'TEST.OTF'.
  APPEND mailhead.
*  creation of the entry for the compressed attachment
  mailpack-transf_bin = 'X'.
  mailpack-head_start = 1.
  mailpack-head_num = 1.
  mailpack-body_start = 1.
  mailpack-body_num = tab_lines.
  mailpack-doc_type = 'OTF'.
  mailpack-obj_name = 'TEST'.
  mailpack-obj_descr = 'Subject'.
  mailpack-doc_size = tab_lines * 255.
  APPEND mailpack.


mailrec-receiver = 'xxx@gmail.com'.
  mailrec-rec_type = 'U'.
  APPEND mailrec.
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = maildata
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      packing_list               = mailpack
      object_header              = mailhead
      contents_bin               = mailbin
      contents_txt               = mailtxt
      receivers                  = mailrec
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_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.

 

with the above code program is not converting into pdf.

after calling close form or before calling close form do I need to use any FM to convert the data into PDF.

 

Could  anyone please help me in this regards.

 

Thanks in advance,

Sravan

Implementing IF_CONSTRAINT Test-Driven

$
0
0

Dear Fellow ABAPers,

 

currently I am writing a custom ABAP Unit Assertion for comparing two structures for partial equality.

The path of choice is implementing the interface IF_CONSTRAINT, and using the resulting class (comparable to a Hamcrest matcher) in combination with the standard assertion method CL_ABAP_UNIT_ASSERT=>ASSERT_THAT.

 

I am doing this test-driven, so at this stage I am testing my IF_CONSTRAINT~IS_VALID implementation with two structures with different values and assert the result to be false in my test method.

 

However, as I am using a CL_ABAP_UNIT_ASSERT=>ASSERT_EQUALS inside my IS_VALID method for the actual value comparison (to easily get the nice Expected/Actual messages in the ABAP Unit result), that intentionally failing ASSERT_EQUALS gets tracked in the test result and makes the actually passing test fail for the ABAP Unit runner (setting the assert level to TOLERABLE just makes the result yellow, not green).

 

Is there a possibility to make the unit runner ignore the used ASSERT_EQUALS, by calling some test framework methods in the test method?

 

I want to avoid having to duplicate the code in ASSERT_EQUALS just for the sake of a green test.

 

Best regards,

Frank.

ALV Grid grouping with a checkbox

$
0
0

Hello,

 

I have an ALV grid that displays customer master data, which is grouped by customer number. I added a custom check-box to the table and the grouping disappears when the check-box is made editable. Is there a way to have a custom check-box for each grouped customer number that is editable?

 

Thanks,


Zach

Viewing all 8332 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>